mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Test
This commit is contained in:
parent
c6c36e7358
commit
922e30f10e
12
lib/util.js
12
lib/util.js
@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
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 });
|
||||||
exports.suppressSensitiveInformation = exports.hasRequiredParameters = exports.generateRepositoryPath = exports.generateTokenType = exports.isNullOrUndefined = void 0;
|
exports.suppressSensitiveInformation = exports.hasRequiredParameters = exports.generateRepositoryPath = exports.generateTokenType = exports.isNullOrUndefined = void 0;
|
||||||
const core_1 = require("@actions/core");
|
const core_1 = require("@actions/core");
|
||||||
|
const fs_1 = __importDefault(require("fs"));
|
||||||
/* Utility function that checks to see if a value is undefined or not. */
|
/* Utility function that checks to see if a value is undefined or not. */
|
||||||
exports.isNullOrUndefined = (value) => typeof value === 'undefined' || value === null || value === '';
|
exports.isNullOrUndefined = (value) => typeof value === 'undefined' || value === null || value === '';
|
||||||
/* Generates a token type used for the action. */
|
/* Generates a token type used for the action. */
|
||||||
@ -34,11 +38,9 @@ exports.hasRequiredParameters = (action) => {
|
|||||||
if (action.folder.startsWith('/') || action.folder.startsWith('./')) {
|
if (action.folder.startsWith('/') || action.folder.startsWith('./')) {
|
||||||
throw new Error("Incorrectly formatted build folder. The deployment folder cannot be prefixed with '/' or './'. Instead reference the folder name directly.");
|
throw new Error("Incorrectly formatted build folder. The deployment folder cannot be prefixed with '/' or './'. Instead reference the folder name directly.");
|
||||||
}
|
}
|
||||||
// if (!existsSync(action.folder) && action.folder !== action.root) {
|
if (!fs_1.default.existsSync(action.folder) && action.folder !== action.root) {
|
||||||
// throw new Error(
|
throw new Error(`The ${action.folder} directory you're trying to deploy doesn't exist. ❗`);
|
||||||
// `The ${action.folder} directory you're trying to deploy doesn't exist. ❗`
|
}
|
||||||
// )
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
/* Suppresses sensitive information from being exposed in error messages. */
|
/* Suppresses sensitive information from being exposed in error messages. */
|
||||||
exports.suppressSensitiveInformation = (str, action) => {
|
exports.suppressSensitiveInformation = (str, action) => {
|
||||||
|
12
src/util.ts
12
src/util.ts
@ -1,5 +1,5 @@
|
|||||||
import {isDebug} from '@actions/core'
|
import {isDebug} from '@actions/core'
|
||||||
// import {existsSync} from 'fs'
|
import fs from 'fs'
|
||||||
import {ActionInterface} from './constants'
|
import {ActionInterface} from './constants'
|
||||||
|
|
||||||
/* Utility function that checks to see if a value is undefined or not. */
|
/* Utility function that checks to see if a value is undefined or not. */
|
||||||
@ -52,11 +52,11 @@ export const hasRequiredParameters = (action: ActionInterface): void => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!existsSync(action.folder) && action.folder !== action.root) {
|
if (!fs.existsSync(action.folder) && action.folder !== action.root) {
|
||||||
// throw new Error(
|
throw new Error(
|
||||||
// `The ${action.folder} directory you're trying to deploy doesn't exist. ❗`
|
`The ${action.folder} directory you're trying to deploy doesn't exist. ❗`
|
||||||
// )
|
)
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Suppresses sensitive information from being exposed in error messages. */
|
/* Suppresses sensitive information from being exposed in error messages. */
|
||||||
|
Loading…
Reference in New Issue
Block a user