Skip to content

Commit

Permalink
fix: enabled mkdir on Windows app
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud committed Oct 8, 2024
1 parent a2f66ea commit 0ca4450
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/handlers/initHandlers/plugin_canInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ export const initSudoFixNpmDirRights = (
const toReturned = new ConfigData('fix_npm_user_rights')
return new Promise<ConfigData>((resolve) => {
const libPath = path.join(`lib`, `node_modules`)
const cmd = `mkdir -p $(npm config get prefix)/${libPath} && chown -R $USER $(npm config get prefix)/{${libPath},bin,share} && echo "Done"`
let cmd = ``
if (os.platform() === 'win32') {
cmd = `mkdir $(npm config get prefix)/${libPath} && chown -R $USER $(npm config get prefix)/{${libPath},bin,share} && echo "Done"`
} else {
cmd = `mkdir -p $(npm config get prefix)/${libPath} && chown -R $USER $(npm config get prefix)/{${libPath},bin,share} && echo "Done"`
}
sudoPrompt.exec(
cmd,
{ name: 'Fix user permissions on Node' },
Expand Down

0 comments on commit 0ca4450

Please sign in to comment.