Skip to content

Commit

Permalink
Update util.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jun 6, 2020
1 parent 3ee16c4 commit 4651ede
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.suppressSensitiveInformation = exports.hasRequiredParameters = exports.generateRepositoryPath = exports.generateTokenType = exports.isNullOrUndefined = void 0;
const core_1 = require("@actions/core");
const fs_1 = require("fs");
/* Utility function that checks to see if a value is undefined or not. */
exports.isNullOrUndefined = (value) => typeof value === 'undefined' || value === null || value === '';
/* Generates a token type used for the action. */
Expand Down Expand Up @@ -34,6 +35,9 @@ exports.hasRequiredParameters = (action) => {
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.");
}
if (!fs_1.existsSync(action.folder) && action.folder !== action.root) {
throw new Error(`The ${action.folder} directory you're trying to deploy doesn't exist. ❗`);
}
};
/* Suppresses sensitive information from being exposed in error messages. */
exports.suppressSensitiveInformation = (str, action) => {
Expand Down

0 comments on commit 4651ede

Please sign in to comment.