mirror of
https://code.forgejo.org/actions/checkout
synced 2025-04-22 08:43:52 +08:00
Do not delete cwd (#86)
This commit is contained in:
parent
cc70598ce8
commit
689bf84be4
2 changed files with 12 additions and 4 deletions
|
@ -59,8 +59,12 @@ export async function getSource(settings: ISourceSettings): Promise<void> {
|
|||
settings.clean
|
||||
))
|
||||
) {
|
||||
await io.rmRF(settings.repositoryPath)
|
||||
await 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 await fs.promises.readdir(settings.repositoryPath)) {
|
||||
await io.rmRF(path.join(settings.repositoryPath, file))
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the repository
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue