Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/dist/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'dist/index.js')
-rw-r--r--dist/index.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/dist/index.js b/dist/index.js
index 0ea446b..4a1027b 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -4978,8 +4978,12 @@ function getSource(settings) {
// Try prepare existing directory, otherwise recreate
if (isExisting &&
!(yield tryPrepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean))) {
- yield io.rmRF(settings.repositoryPath);
- yield io.mkdirP(settings.repositoryPath);
+ // Delete the contents of the directory. Don't delete the directory itself
+ // since it may be the current working directory.
+ core.info(`Deleting the contents of '${settings.repositoryPath}'`);
+ for (const file of yield fs.promises.readdir(settings.repositoryPath)) {
+ yield io.rmRF(path.join(settings.repositoryPath, file));
+ }
}
// Initialize the repository
if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {