@spicemod/creator 0.0.27 → 0.0.28

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.
Files changed (2) hide show
  1. package/dist/bin.mjs +31 -42
  2. 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.27";
147
+ var version = "0.0.28";
148
148
 
149
149
  //#endregion
150
150
  //#region src/utils/common.ts
@@ -925,47 +925,35 @@ const spicetifyHandler = ({ config, options, cache, logger = createLogger("plugi
925
925
  if (copy) dirs.push(isExtension ? getExtensionDir() : isCustomApp ? resolve(getCustomAppsDir(), identifier) : resolve(getThemesDir(), identifier));
926
926
  return dirs;
927
927
  };
928
- if (env.skipSpicetify) {
929
- logger.info(pc.yellow("skipping spicetify operations"));
930
- build.onEnd(async (result) => {
931
- if (result.errors.length > 0) return;
932
- const destDirs = getDestDirs();
933
- await copyFiles(logger, destDirs, cache.files);
934
- logger.debug(pc.green(`${CHECK} Built files written to ${outDir}`));
935
- if (cache.removed.size > 0) {
936
- await removeDeletedFiles(logger, destDirs, cache.removed);
937
- cache.hasChanges = true;
928
+ if (env.skipSpicetify) logger.info(pc.yellow("Skipping Spicetify operations..."));
929
+ else {
930
+ const spiceConfig = await getSpicetifyConfig();
931
+ logger.debug(pc.green("Spicetify Config: "), spiceConfig);
932
+ if (apply) {
933
+ const defaultTheme = spiceConfig?.Setting?.current_theme || "SpicetifyDefault";
934
+ const spiceIdentifier = remove ? `${identifier}-` : identifier;
935
+ runSpice([
936
+ "config",
937
+ isExtension ? "extensions" : isCustomApp ? "custom_apps" : "current_theme",
938
+ spiceIdentifier
939
+ ]);
940
+ if (!isExtension && !remove) {
941
+ const cleanup = () => {
942
+ if (isCustomApp) runSpice([
943
+ "config",
944
+ "custom_apps",
945
+ `${identifier}-`
946
+ ]);
947
+ else runSpice([
948
+ "config",
949
+ "current_theme",
950
+ defaultTheme
951
+ ]);
952
+ process.exit();
953
+ };
954
+ process.once("SIGINT", cleanup);
955
+ process.once("SIGTERM", cleanup);
938
956
  }
939
- cache.removed.clear();
940
- });
941
- return;
942
- }
943
- const spiceConfig = await getSpicetifyConfig();
944
- logger.debug(pc.green("Spicetify Config: "), spiceConfig);
945
- if (apply) {
946
- const defaultTheme = spiceConfig?.Setting?.current_theme || "SpicetifyDefault";
947
- const spiceIdentifier = remove ? `${identifier}-` : identifier;
948
- runSpice([
949
- "config",
950
- isExtension ? "extensions" : isCustomApp ? "custom_apps" : "current_theme",
951
- spiceIdentifier
952
- ]);
953
- if (!isExtension && !remove) {
954
- const cleanup = () => {
955
- if (isCustomApp) runSpice([
956
- "config",
957
- "custom_apps",
958
- `${identifier}-`
959
- ]);
960
- else runSpice([
961
- "config",
962
- "current_theme",
963
- defaultTheme
964
- ]);
965
- process.exit();
966
- };
967
- process.once("SIGINT", cleanup);
968
- process.once("SIGTERM", cleanup);
969
957
  }
970
958
  }
971
959
  build.onEnd(async (result) => {
@@ -973,7 +961,7 @@ const spicetifyHandler = ({ config, options, cache, logger = createLogger("plugi
973
961
  const destDirs = getDestDirs();
974
962
  try {
975
963
  await copyFiles(logger, destDirs, cache.files);
976
- logger.debug(pc.green(`${CHECK} Changed files copied.`));
964
+ logger.debug(pc.green(`${CHECK} Built files written to ${outDir}`));
977
965
  } catch (err) {
978
966
  logger.error(pc.red(`${CROSS} Failed to copy files: ${err instanceof Error ? err.message : String(err)}`));
979
967
  return;
@@ -983,6 +971,7 @@ const spicetifyHandler = ({ config, options, cache, logger = createLogger("plugi
983
971
  cache.hasChanges = true;
984
972
  }
985
973
  cache.removed.clear();
974
+ if (env.skipSpicetify) return;
986
975
  if (apply && cache.hasChanges && (!applyOnce || !hasAppliedOnce)) {
987
976
  const { stdout, stderr, status } = runSpice(["apply"]);
988
977
  if (status !== 0) logger.error(pc.red(`${CROSS} Spicetify apply failed:`), stdout, stderr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicemod/creator",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Easily make Spicetify extensions and themes",
5
5
  "keywords": [
6
6
  "cli",