Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid confusing error output from cp #698

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
avoid confusing error output from cp
  • Loading branch information
xabbu42 committed Dec 8, 2023
commit 77456e540b843259fed592862f5da0a57c5c7dfe
9 changes: 5 additions & 4 deletions src/git-utils.ts
Original file line number Diff line number Diff line change
@@ -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']);
@@ -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;
}

@@ -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);