Skip to content

Commit 92faf78

Browse files
authored
Merge pull request #83 from jdcmarques/feat/replace-copy-with-node
feat: replace copy with node implementation
2 parents aa7ffa5 + 2868a31 commit 92faf78

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

action/dist/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12305,11 +12305,9 @@ const main = async ({ env = process.env, log, }) => {
1230512305
// Make sure the destination folder exists
1230612306
await (0, io_1.mkdirP)(path.resolve(REPO_TEMP, destinationFolder));
1230712307
log.log(`##[info] Copying all files from ${folder}`);
12308-
// TODO: replace this copy with a node implementation
12309-
await (0, exports.exec)(`cp -rT "${folder}"/ ${destinationFolder}`, {
12310-
log,
12311-
env: childEnv,
12312-
cwd: REPO_TEMP,
12308+
await (0, io_1.cp)(`${folder}/`, `${REPO_TEMP}/${destinationFolder}/`, {
12309+
recursive: true,
12310+
copySourceDirectory: false,
1231312311
});
1231412312
await (0, exports.exec)(`git add -A .`, { log, env: childEnv, cwd: REPO_TEMP });
1231512313
const message = config.message

action/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import gitUrlParse from 'git-url-parse';
55
import { homedir, tmpdir } from 'os';
66
import * as path from 'path';
77
import git from 'isomorphic-git';
8-
import { mkdirP } from '@actions/io';
8+
import { mkdirP, cp } from '@actions/io';
99

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

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

0 commit comments

Comments
 (0)