chore: rm prefixed error msg

Signed-off-by: Dwi Siswanto <me@dw1.io>
This commit is contained in:
Dwi Siswanto 2024-03-22 00:25:26 +07:00
parent f67be5d91a
commit a8d8f573cf
No known key found for this signature in database
GPG Key ID: D192CC08161630BD
4 changed files with 16 additions and 16 deletions

14
dist/index.js vendored
View File

@ -52,7 +52,7 @@ function get_slim() {
}
}
catch (_a) {
throw new Error(`ERROR! Could not get the Slim version ${VER}.`);
throw new Error(`Could not get the Slim version ${VER}.`);
}
URL = `https://downloads.dockerslim.com/releases/${VER}`;
// Get kernel name and machine architecture.
@ -81,11 +81,11 @@ function get_slim() {
}
}
else {
throw new Error(`ERROR! ${KERNEL} is not a supported platform.`);
throw new Error(`${KERNEL} is not a supported platform.`);
}
// Was a known distribution detected?
if (!DIST) {
throw new Error(`ERROR! ${MACHINE} is not a supported architecture.`);
throw new Error(`${MACHINE} is not a supported architecture.`);
}
// Derive the filename
FILENAME = `dist_${DIST}.${EXT}`;
@ -97,7 +97,7 @@ function get_slim() {
const_1.core.debug('Restoring cache');
const cacheResult = yield const_1.cache.restoreCache([cachePath], cacheKey, [`${cachePrefix}-`]);
if (typeof cacheResult === 'undefined') {
throw new Error(`ERROR! Cache miss: ${cacheKey} was not found in the cache.`);
throw new Error(`Cache miss: ${cacheKey} was not found in the cache.`);
}
const_1.core.debug(`${cacheKey} cache was restored.`);
SLIM_PATH = cachePath;
@ -132,7 +132,7 @@ function get_slim() {
});
}
else {
throw new Error('ERROR! Unexpected file extension.');
throw new Error('Unexpected file extension.');
}
SLIM_PATH = const_1.path.join(const_1.TMP_DIR, `dist_${DIST}`);
const_1.core.debug(`Copying ${SLIM_PATH} -> (${cachePath})`);
@ -161,7 +161,7 @@ function run() {
const report = JSON.parse(data);
const_1.core.setOutput('report', report);
if (report.state == 'error') {
throw new Error('ERROR! Cannot build over target');
throw new Error('Cannot build over target');
}
const [image, tag] = report.target_reference.split(':');
if (inputOverwrite && tag) {
@ -174,7 +174,7 @@ function run() {
});
}
if (inputTag == "") {
const_1.core.setFailed('ERROR! Tag cannot be empty.');
const_1.core.setFailed('Tag cannot be empty.');
}
try {
run();

2
dist/pre.js vendored
View File

@ -6,5 +6,5 @@ try {
const_1.core.info('docker command OK!');
}
catch (_a) {
const_1.core.setFailed('ERROR! docker: command not found');
const_1.core.setFailed('docker: command not found');
}

View File

@ -46,7 +46,7 @@ async function get_slim() {
VER = inputVersion;
}
} catch {
throw new Error(`ERROR! Could not get the Slim version ${VER}.`);
throw new Error(`Could not get the Slim version ${VER}.`);
}
URL = `https://downloads.dockerslim.com/releases/${VER}`;
@ -73,12 +73,12 @@ async function get_slim() {
DIST = 'mac_m1';
}
} else {
throw new Error(`ERROR! ${KERNEL} is not a supported platform.`);
throw new Error(`${KERNEL} is not a supported platform.`);
}
// Was a known distribution detected?
if (!DIST) {
throw new Error(`ERROR! ${MACHINE} is not a supported architecture.`);
throw new Error(`${MACHINE} is not a supported architecture.`);
}
// Derive the filename
@ -96,7 +96,7 @@ async function get_slim() {
);
if (typeof cacheResult === 'undefined') {
throw new Error(`ERROR! Cache miss: ${cacheKey} was not found in the cache.`)
throw new Error(`Cache miss: ${cacheKey} was not found in the cache.`)
}
core.debug(`${cacheKey} cache was restored.`)
@ -132,7 +132,7 @@ async function get_slim() {
cwd: TMP_DIR
});
} else {
throw new Error('ERROR! Unexpected file extension.');
throw new Error('Unexpected file extension.');
}
SLIM_PATH = path.join(TMP_DIR, `dist_${DIST}`);
@ -168,7 +168,7 @@ async function run() {
core.setOutput('report', report);
if (report.state == 'error') {
throw new Error('ERROR! Cannot build over target');
throw new Error('Cannot build over target');
}
const [image, tag] = report.target_reference.split(':');
@ -185,7 +185,7 @@ async function run() {
}
if (inputTag == "") {
core.setFailed('ERROR! Tag cannot be empty.');
core.setFailed('Tag cannot be empty.');
}
try {

View File

@ -4,5 +4,5 @@ try {
io.which('docker', true);
core.info('docker command OK!');
} catch {
core.setFailed('ERROR! docker: command not found');
core.setFailed('docker: command not found');
}