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