This commit is contained in:
CrazyMax 2019-11-15 16:09:01 +01:00
parent d40e8cac3d
commit 8cdc7f91b1
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 9 additions and 10 deletions

View File

@ -15,14 +15,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
result["default"] = mod; result["default"] = mod;
return result; return result;
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const child_process = __importStar(require("child_process")); const child_process = __importStar(require("child_process"));
const core = __importStar(require("@actions/core")); const core = __importStar(require("@actions/core"));
const exec = __importStar(require("@actions/exec")); const exec = __importStar(require("@actions/exec"));
const ncp_1 = __importDefault(require("ncp")); const ncp_1 = require("ncp");
const fs = __importStar(require("fs")); const fs = __importStar(require("fs"));
const os = __importStar(require("os")); const os = __importStar(require("os"));
const path = __importStar(require("path")); const path = __importStar(require("path"));
@ -63,7 +60,7 @@ function run() {
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'github-pages-')); const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'github-pages-'));
process.chdir(tmpdir); process.chdir(tmpdir);
core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${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) { if (err !== null) {
core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`); core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`);
} }

View File

@ -1,7 +1,7 @@
import * as child_process from 'child_process'; import * as child_process from 'child_process';
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 ncp from 'ncp'; import {ncp} from 'ncp';
import * as fs from 'fs'; import * as fs from 'fs';
import * as os from 'os'; import * as os from 'os';
import * as path from 'path'; import * as path from 'path';
@ -45,10 +45,12 @@ async function run() {
process.chdir(tmpdir); process.chdir(tmpdir);
core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${tmpdir}`); core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${tmpdir}`);
ncp.ncp(path.resolve(build_dir), tmpdir, err => { await new Promise((resolve, reject) => {
if (err !== null) { ncp.ncp(path.resolve(build_dir), tmpdir, (err) => {
core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`); if (err) {
} core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`);
}
});
}); });
const remote_branch_exists = const remote_branch_exists =