Run linter

This commit is contained in:
Danny McCormick
2019-05-20 19:17:56 -04:00
parent e6cc6dc147
commit 97c1e7df5a
3 changed files with 137 additions and 133 deletions

View File

@@ -1,6 +1,6 @@
import im = require('./interfaces');
import intm = require('./internal');
import process = require('process');
import im = require('./interfaces')
import intm = require('./internal')
import process = require('process')
//-----------------------------------------------------------------------
// Variables
@@ -12,8 +12,8 @@ import process = require('process');
* @param val the value of the variable
*/
export function exportVariable(name: string, val: string) {
process.env[name] = val;
intm._issueCommand('set-variable', {'name': name}, val);
process.env[name] = val
intm._issueCommand('set-variable', {name: name}, val)
}
/**
@@ -22,24 +22,25 @@ export function exportVariable(name: string, val: string) {
* @param val value of the secret
*/
export function setSecret(name: string, val: string) {
exportVariable(name, val);
intm._issueCommand('set-secret', {}, val);
}
exportVariable(name, val)
intm._issueCommand('set-secret', {}, val)
}
/**
* Gets the value of an input. The value is also trimmed.
*
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string
*/
export function getInput(name: string, options?: im.InputOptions): string {
let val: string = process.env['INPUT_' + name.replace(' ', '_').toUpperCase()] || '';
if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`);
}
let val: string =
process.env['INPUT_' + name.replace(' ', '_').toUpperCase()] || ''
if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`)
}
return val.trim();
return val.trim()
}
//-----------------------------------------------------------------------
@@ -50,17 +51,17 @@ export function getInput(name: string, options?: im.InputOptions): string {
* Sets the action status to neutral
*/
export function setNeutral() {
process.exitCode = im.ExitCode.Neutral;
process.exitCode = im.ExitCode.Neutral
}
/**
* Sets the action status to failed.
* Sets the action status to failed.
* When the action exits it will be with an exit code of 1
* @param message add error issue message
*/
export function setFailed(message: string) {
process.exitCode = im.ExitCode.Failure;
error(message);
process.exitCode = im.ExitCode.Failure
error(message)
}
//-----------------------------------------------------------------------
@@ -72,7 +73,7 @@ export function setFailed(message: string) {
* @param message debug message
*/
export function debug(message: string) {
intm._issueCommand('debug', {}, message);
intm._issueCommand('debug', {}, message)
}
/**
@@ -80,7 +81,7 @@ export function debug(message: string) {
* @param message error issue message
*/
export function error(message: string) {
intm._issue('error', message);
intm._issue('error', message)
}
/**
@@ -88,5 +89,5 @@ export function error(message: string) {
* @param message warning issue message
*/
export function warning(message: string) {
intm._issue('warning', message);
intm._issue('warning', message)
}