fix: KeepFiles behaviour when DestinationDir has dir (#405)
Related to #324
This commit is contained in:
parent
3874723ac6
commit
ce4e3beff1
|
@ -73,11 +73,23 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
if (result.exitcode === 0) {
|
if (result.exitcode === 0) {
|
||||||
process.chdir(workDir);
|
await createDir(destDir);
|
||||||
if (inps.KeepFiles) {
|
process.chdir(destDir);
|
||||||
core.info('[INFO] Keep existing files');
|
|
||||||
|
if (inps.DestinationDir !== '') {
|
||||||
|
if (inps.KeepFiles) {
|
||||||
|
core.info('[INFO] Keep existing files');
|
||||||
|
} else {
|
||||||
|
core.info(`[INFO] clean up ${destDir}`);
|
||||||
|
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
if (inps.KeepFiles) {
|
||||||
|
core.info('[INFO] Keep existing files');
|
||||||
|
} else {
|
||||||
|
core.info(`[INFO] clean up ${destDir}`);
|
||||||
|
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await copyAssets(publishDir, destDir);
|
await copyAssets(publishDir, destDir);
|
||||||
|
|
Loading…
Reference in New Issue