Skip to content

Commit

Permalink
feat: replace cp with node implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcmarques authored and s0 committed Nov 17, 2022
1 parent aa7ffa5 commit 2868a31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12305,11 +12305,9 @@ const main = async ({ env = process.env, log, }) => {
// Make sure the destination folder exists
await (0, io_1.mkdirP)(path.resolve(REPO_TEMP, destinationFolder));
log.log(`##[info] Copying all files from ${folder}`);
// TODO: replace this copy with a node implementation
await (0, exports.exec)(`cp -rT "${folder}"/ ${destinationFolder}`, {
log,
env: childEnv,
cwd: REPO_TEMP,
await (0, io_1.cp)(`${folder}/`, `${REPO_TEMP}/${destinationFolder}/`, {
recursive: true,
copySourceDirectory: false,
});
await (0, exports.exec)(`git add -A .`, { log, env: childEnv, cwd: REPO_TEMP });
const message = config.message
Expand Down
10 changes: 4 additions & 6 deletions action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import gitUrlParse from 'git-url-parse';
import { homedir, tmpdir } from 'os';
import * as path from 'path';
import git from 'isomorphic-git';
import { mkdirP } from '@actions/io';
import { mkdirP, cp } from '@actions/io';

export type Console = {
readonly log: (...msg: unknown[]) => void;
Expand Down Expand Up @@ -579,11 +579,9 @@ export const main = async ({
await mkdirP(path.resolve(REPO_TEMP, destinationFolder));

log.log(`##[info] Copying all files from ${folder}`);
// TODO: replace this copy with a node implementation
await exec(`cp -rT "${folder}"/ ${destinationFolder}`, {
log,
env: childEnv,
cwd: REPO_TEMP,
await cp(`${folder}/`, `${REPO_TEMP}/${destinationFolder}/`, {
recursive: true,
copySourceDirectory: false,
});
await exec(`git add -A .`, { log, env: childEnv, cwd: REPO_TEMP });
const message = config.message
Expand Down

0 comments on commit 2868a31

Please sign in to comment.