mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 22:29:17 +08:00
refactor: print log
This commit is contained in:
parent
a2d0650d54
commit
a8fc36ee8b
@ -6,7 +6,7 @@ import path from 'path';
|
||||
import fs from 'fs';
|
||||
import {Inputs, CmdResult} from './interfaces';
|
||||
import {createDir} from './utils';
|
||||
import {cp} from 'shelljs';
|
||||
import {cp, ls} from 'shelljs';
|
||||
|
||||
export async function createBranchForce(branch: string): Promise<void> {
|
||||
await exec.exec('git', ['init']);
|
||||
@ -39,16 +39,17 @@ export async function copyAssets(
|
||||
): Promise<void> {
|
||||
core.info(`[INFO] prepare publishing assets`);
|
||||
|
||||
!fs.existsSync(destDir) && (await createDir(destDir));
|
||||
|
||||
const dotGitPath = path.join(publishDir, '.git');
|
||||
if (fs.existsSync(dotGitPath)) {
|
||||
core.info(`[INFO] delete ${dotGitPath}`);
|
||||
io.rmRF(dotGitPath);
|
||||
}
|
||||
|
||||
console.log(ls('-A', publishDir));
|
||||
console.log(ls('-A', destDir));
|
||||
core.info(`[INFO] copy ${publishDir} to ${destDir}`);
|
||||
cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], destDir);
|
||||
console.log(ls('-A', destDir));
|
||||
|
||||
await deleteExcludedAssets(destDir, excludeAssets);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user