@spicemod/creator 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +7 -3
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -144,7 +144,7 @@ const customAppEntryFilePath = dist("templates/customAppEntry.js", import.meta.u
|
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region package.json
|
|
146
146
|
var name = "@spicemod/creator";
|
|
147
|
-
var version = "0.0.
|
|
147
|
+
var version = "0.0.29";
|
|
148
148
|
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/utils/common.ts
|
|
@@ -409,7 +409,7 @@ const OptionsSchema$1 = v.intersect([
|
|
|
409
409
|
//#region src/env.ts
|
|
410
410
|
const isDev = process.env.IS_DEV === "true";
|
|
411
411
|
const spicetifyBin = process.env.SPICETIFY_BIN || process.env.SPICE_BIN || "spicetify";
|
|
412
|
-
const skipSpicetify = process.env.SPICETIFY_SKIP === "true" || process.env.CI
|
|
412
|
+
const skipSpicetify = process.env.SPICETIFY_SKIP === "true" || !!process.env.CI;
|
|
413
413
|
const env = {
|
|
414
414
|
isDev,
|
|
415
415
|
spicetifyBin,
|
|
@@ -509,6 +509,7 @@ const SpicetifyConfigSchema = v.object({
|
|
|
509
509
|
//#endregion
|
|
510
510
|
//#region src/utils/spicetify/index.ts
|
|
511
511
|
function runSpice(args) {
|
|
512
|
+
if (env.skipSpicetify) throw new Error("Spicetify operations are disabled in CI");
|
|
512
513
|
validateSpicetify(env.spicetifyBin);
|
|
513
514
|
return spawnSync(env.spicetifyBin, args, { encoding: "utf-8" });
|
|
514
515
|
}
|
|
@@ -516,6 +517,7 @@ const getCustomAppsDir = () => join(getSpiceDataPath(), "CustomApps");
|
|
|
516
517
|
const getExtensionDir = () => join(getSpiceDataPath(), "Extensions");
|
|
517
518
|
const getThemesDir = () => join(getSpiceDataPath(), "Themes");
|
|
518
519
|
async function getSpicetifyConfig() {
|
|
520
|
+
if (env.skipSpicetify) throw new Error("Spicetify operations are disabled in CI");
|
|
519
521
|
const { stdout, stderr, error } = runSpice(["path", "-c"]);
|
|
520
522
|
if (error || stderr) throw new Error(`Failed to locate Spicetify config: ${stderr || error?.message}`);
|
|
521
523
|
const rawConfig = parse(await readFile(stdout.trim(), "utf-8"));
|
|
@@ -524,11 +526,13 @@ async function getSpicetifyConfig() {
|
|
|
524
526
|
else throw new Error("Spicetify Config Validation Failed:", v.flatten(result.issues).nested);
|
|
525
527
|
}
|
|
526
528
|
function getSpiceDataPath() {
|
|
529
|
+
if (env.skipSpicetify) throw new Error("Spicetify operations are disabled in CI");
|
|
527
530
|
const { stdout, stderr, error } = runSpice(["path", "userdata"]);
|
|
528
531
|
if (error || stderr) throw new Error(`Failed to locate Spicetify config: ${stderr || error?.message}`);
|
|
529
532
|
return stdout.trim();
|
|
530
533
|
}
|
|
531
534
|
function validateSpicetify(bin) {
|
|
535
|
+
if (env.skipSpicetify) return;
|
|
532
536
|
const result = spawnSync(bin, ["--version"], { encoding: "utf-8" });
|
|
533
537
|
if (result.error) throw result.error;
|
|
534
538
|
if (result.status !== 0) throw new Error(`Invalid spicetify binary "${bin}": ${result.stderr || "unknown error"}`);
|
|
@@ -922,7 +926,7 @@ const spicetifyHandler = ({ config, options, cache, logger = createLogger("plugi
|
|
|
922
926
|
const identifier = isExtension ? `${urlSlugify(config.name)}.js` : urlSlugify(getEnName(config.name));
|
|
923
927
|
const getDestDirs = () => {
|
|
924
928
|
const dirs = [resolve(outDir)];
|
|
925
|
-
if (copy) dirs.push(isExtension ? getExtensionDir() : isCustomApp ? resolve(getCustomAppsDir(), identifier) : resolve(getThemesDir(), identifier));
|
|
929
|
+
if (copy && !env.skipSpicetify) dirs.push(isExtension ? getExtensionDir() : isCustomApp ? resolve(getCustomAppsDir(), identifier) : resolve(getThemesDir(), identifier));
|
|
926
930
|
return dirs;
|
|
927
931
|
};
|
|
928
932
|
if (env.skipSpicetify) logger.info(pc.yellow("Skipping Spicetify operations..."));
|