Skip to content

Commit

Permalink
Adding support for Micosoft Windows (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justman100 authored Oct 17, 2024
1 parent 2badb9e commit fcbc5a1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fcbc5a1

Please sign in to comment.