diff --git a/Dockerfile b/Dockerfile index 578bb1a..3388956 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ RUN apt-get update && \ ca-certificates \ wget \ ssh \ + rsync \ vim && \ rm -rf /var/lib/apt/lists/* && \ npm i -g npm diff --git a/src/git-utils.ts b/src/git-utils.ts index cf291ef..00519e0 100644 --- a/src/git-utils.ts +++ b/src/git-utils.ts @@ -17,17 +17,26 @@ export async function copyAssets( publishDir: string, workDir: string ): Promise { - const copyOpts = {recursive: true, force: true}; - const files = fs.readdirSync(publishDir); - core.debug(`${files}`); - for await (const file of files) { - if (file.endsWith('.git') || file.endsWith('.github')) { - continue; - } - const filePath = path.join(publishDir, file); - await io.cp(filePath, `${workDir}/`, copyOpts); - core.info(`[INFO] copy ${file}`); - } + // const copyOpts = {recursive: true, force: true}; + // const files = fs.readdirSync(publishDir); + // core.debug(`${files}`); + await exec.exec('rsync', [ + '-rptgoDv', + '--copy-links', + '--copy-dirlinks', + "--exclude='.git'", + "--exclude='.github'", + `${publishDir}/`, + `${workDir}/` + ]); + // for await (const file of files) { + // if (file.endsWith('.git') || file.endsWith('.github')) { + // continue; + // } + // const filePath = path.join(publishDir, file); + // await io.cp(filePath, `${workDir}/`, copyOpts); + // core.info(`[INFO] copy ${file}`); + // } return; }