fix: Replace io.rmRF with shelljs.rm

This commit is contained in:
peaceiris 2020-10-20 18:15:04 +09:00
parent 39fbbb0526
commit 8ca14120d4
No known key found for this signature in database
GPG Key ID: 5868468A8EBA64EC

View File

@ -1,12 +1,11 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as exec from '@actions/exec'; import * as exec from '@actions/exec';
import * as io from '@actions/io';
import * as glob from '@actions/glob'; import * as glob from '@actions/glob';
import path from 'path'; 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, ls} from 'shelljs'; import {cp, rm, 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']);
@ -27,7 +26,7 @@ export async function deleteExcludedAssets(destDir: string, excludeAssets: strin
const globber = await glob.create(excludedAssetPaths.join('\n')); const globber = await glob.create(excludedAssetPaths.join('\n'));
for await (const asset of globber.globGenerator()) { for await (const asset of globber.globGenerator()) {
core.info(`[INFO] delete ${asset}`); core.info(`[INFO] delete ${asset}`);
io.rmRF(asset); rm('-rf', asset);
} }
return; return;
} }
@ -42,7 +41,7 @@ export async function copyAssets(
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); rm('-rf', dotGitPath);
} }
console.log(ls('-A', publishDir)); console.log(ls('-A', publishDir));