mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-10 22:53:06 +08:00
25 lines
491 B
JavaScript
25 lines
491 B
JavaScript
const fs = require("fs");
|
|
|
|
module.exports.parseFlags = (flags) => {
|
|
if (flags != null && typeof flags == "string" && flags.length > 0) {
|
|
return flags.split(" ");
|
|
}
|
|
|
|
return [];
|
|
};
|
|
|
|
module.exports.parseComposeFiles = (composeFiles) => {
|
|
return composeFiles.filter((composeFile) => {
|
|
if (!composeFile.length) {
|
|
return false;
|
|
}
|
|
|
|
if (!fs.existsSync(composeFile)) {
|
|
console.log(`${composeFile} not exists`);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
});
|
|
};
|