Fix ncp
This commit is contained in:
parent
d40e8cac3d
commit
8cdc7f91b1
|
@ -15,14 +15,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const child_process = __importStar(require("child_process"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const exec = __importStar(require("@actions/exec"));
|
||||
const ncp_1 = __importDefault(require("ncp"));
|
||||
const ncp_1 = require("ncp");
|
||||
const fs = __importStar(require("fs"));
|
||||
const os = __importStar(require("os"));
|
||||
const path = __importStar(require("path"));
|
||||
|
@ -63,7 +60,7 @@ function run() {
|
|||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'github-pages-'));
|
||||
process.chdir(tmpdir);
|
||||
core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${tmpdir}`);
|
||||
ncp_1.default.ncp(path.resolve(build_dir), tmpdir, err => {
|
||||
ncp_1.ncp.ncp(path.resolve(build_dir), tmpdir, err => {
|
||||
if (err !== null) {
|
||||
core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`);
|
||||
}
|
||||
|
|
12
src/main.ts
12
src/main.ts
|
@ -1,7 +1,7 @@
|
|||
import * as child_process from 'child_process';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import ncp from 'ncp';
|
||||
import {ncp} from 'ncp';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
@ -45,10 +45,12 @@ async function run() {
|
|||
process.chdir(tmpdir);
|
||||
|
||||
core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${tmpdir}`);
|
||||
ncp.ncp(path.resolve(build_dir), tmpdir, err => {
|
||||
if (err !== null) {
|
||||
core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`);
|
||||
}
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp.ncp(path.resolve(build_dir), tmpdir, (err) => {
|
||||
if (err) {
|
||||
core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const remote_branch_exists =
|
||||
|
|
Loading…
Reference in New Issue
Block a user