Skip to content

Commit

Permalink
avoid confusing error output from cp
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbu42 committed Dec 8, 2023
1 parent 6cdec55 commit eedbd10
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/git-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import fs from 'fs';
import {URL} from 'url';
import {Inputs, CmdResult} from './interfaces';
import {createDir} from './utils';
import {cp, rm} from 'shelljs';
import shell from 'shelljs';

export async function createBranchForce(branch: string): Promise<void> {
await exec.exec('git', ['init']);
Expand Down Expand Up @@ -34,7 +34,7 @@ export async function deleteExcludedAssets(destDir: string, excludeAssets: strin
for await (const file of globber.globGenerator()) {
core.info(`[INFO] delete ${file}`);
}
rm('-rf', files);
shell.rm('-rf', files);
return;
}

Expand All @@ -53,11 +53,12 @@ export async function copyAssets(
const dotGitPath = path.join(publishDir, '.git');
if (fs.existsSync(dotGitPath)) {
core.info(`[INFO] delete ${dotGitPath}`);
rm('-rf', dotGitPath);
shell.rm('-rf', dotGitPath);
}

core.info(`[INFO] copy ${publishDir} to ${destDir}`);
cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], destDir);
shell.config.globOptions = {dot: true};
shell.cp('-RfL', [`${publishDir}/*`], destDir);

await deleteExcludedAssets(destDir, excludeAssets);

Expand Down

0 comments on commit eedbd10

Please sign in to comment.