mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 22:29:17 +08:00
fix: Use io.cp() on windows
This commit is contained in:
parent
5d8f5a15f7
commit
46146058b6
@ -17,27 +17,29 @@ export async function copyAssets(
|
|||||||
publishDir: string,
|
publishDir: string,
|
||||||
workDir: string
|
workDir: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// const copyOpts = {recursive: true, force: true};
|
if (process.platform === 'win32') {
|
||||||
// const files = fs.readdirSync(publishDir);
|
const copyOpts = {recursive: true, force: true};
|
||||||
// core.debug(`${files}`);
|
const files = fs.readdirSync(publishDir);
|
||||||
await exec.exec('rsync', [
|
core.debug(`${files}`);
|
||||||
'-rptgoDv',
|
for await (const file of files) {
|
||||||
'--copy-links',
|
if (file.endsWith('.git') || file.endsWith('.github')) {
|
||||||
'--copy-dirlinks',
|
continue;
|
||||||
"--exclude='.git'",
|
}
|
||||||
"--exclude='.github'",
|
const filePath = path.join(publishDir, file);
|
||||||
`${publishDir}/`,
|
await io.cp(filePath, `${workDir}/`, copyOpts);
|
||||||
`${workDir}/`
|
core.info(`[INFO] copy ${file}`);
|
||||||
]);
|
}
|
||||||
// for await (const file of files) {
|
} else {
|
||||||
// if (file.endsWith('.git') || file.endsWith('.github')) {
|
await exec.exec('rsync', [
|
||||||
// continue;
|
'-rptgoDv',
|
||||||
// }
|
'--copy-links',
|
||||||
// const filePath = path.join(publishDir, file);
|
'--copy-dirlinks',
|
||||||
// await io.cp(filePath, `${workDir}/`, copyOpts);
|
"--exclude='.git'",
|
||||||
// core.info(`[INFO] copy ${file}`);
|
"--exclude='.github'",
|
||||||
// }
|
`${publishDir}/`,
|
||||||
|
`${workDir}/`
|
||||||
|
]);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user