Skip to content

Commit 287a7a8

Browse files
committed
avoid confusing error output from cp
1 parent 127e2d7 commit 287a7a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/git-utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import fs from 'fs';
66
import {URL} from 'url';
77
import {Inputs, CmdResult} from './interfaces';
88
import {createDir} from './utils';
9-
import {cp, rm} from 'shelljs';
9+
import shell from 'shelljs';
1010

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

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

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

6263
await deleteExcludedAssets(destDir, excludeAssets);
6364

0 commit comments

Comments
 (0)