Fixed checks of path and custom theme

This commit is contained in:
niktek
2023-08-30 14:11:02 +10:00
parent c5b5567fe9
commit 070d4f5a7c
3 changed files with 7 additions and 1 deletions

View File

@@ -268,7 +268,7 @@ export function createTailwindConfig(opts) {
if (configs.themes.preset.length == 0) delete configs.themes.preset;
if (configs.themes.custom.length == 0) delete configs.themes.custom;
let configsStr = JSON5.stringify(configs, { space: '\t' });
if (configs.themes.custom.length) {
if (configs.themes?.custom?.length) {
// stringify adds quotes around the custom theme imported variable, we need to remove them
configsStr = configsStr.replace(`'${configs.themes.custom}'`, configs.themes.custom);
}

View File

@@ -154,6 +154,7 @@ Problems? Open an issue on ${cyan('https://github.com/skeletonlabs/skeleton/issu
});
goodbye(opts.path);
}
if (opts?.path == undefined) opts.path = "."
// name to set in package.json
opts.name = basename(opts.path);