2022-02-10 12:07:06 -08:00
|
|
|
import gulp from "gulp";
|
|
|
|
import { checkEnvironmentalVariables } from "../../util/util";
|
|
|
|
|
|
|
|
const vars = [
|
|
|
|
"GITHUB_TOKEN",
|
|
|
|
"GITHUB_REPOSITORY",
|
|
|
|
"GITHUB_SHA",
|
|
|
|
"GITHUB_REF",
|
|
|
|
"CURSEFORGE_PROJECT_ID",
|
|
|
|
"CURSEFORGE_API_TOKEN",
|
2022-07-07 16:11:30 +08:00
|
|
|
"CFCORE_API_TOKEN",
|
2022-02-10 12:07:06 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check required env. variables for vailidity and cancel
|
|
|
|
* the build if something is unset.
|
|
|
|
*/
|
|
|
|
async function checkEnv() {
|
|
|
|
checkEnvironmentalVariables(vars);
|
|
|
|
|
|
|
|
if (!/.+\/.+/.exec(process.env.GITHUB_REPOSITORY)) {
|
|
|
|
throw new Error("Malformed repository slug.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default gulp.series(checkEnv);
|