diff --git a/scripts/create.mjs b/scripts/create.mjs index 096257e05..85e6f4f6e 100644 --- a/scripts/create.mjs +++ b/scripts/create.mjs @@ -43,10 +43,16 @@ const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only cont (async () => { // Folder paths const userData = - process.env.APPDATA || - (process.platform === 'darwin' + process.env.APPDATA || ( + // Check if this script runs on Windows + process.platform === 'win32' + ? `${process.env.USERPROFILE}\\AppData\\Roaming\\Ferdium\\recipes\\dev` + // If not, check for Darwin + : process.platform === 'darwin' ? `${process.env.HOME}/Library/Application Support` - : `${process.env.HOME}/.config`); + // If fails both checks, simply use this + : `${process.env.HOME}/.config` + ); const recipesFolder = path.join(userData, folderName, 'recipes'); const devRecipeFolder = path.join(recipesFolder, 'dev'); const newRecipeFolder = path.join(devRecipeFolder, recipe);