From eef8f6e03c2a6c151c0d9a25ad81925ebdab5903 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Sun, 23 May 2021 12:06:13 -0600 Subject: [PATCH] Fix: Adjust Paths for Setup Run --- Launch-Scripts/create-shortcut.js | 13 ++++--------- setup.js | 1 + 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Launch-Scripts/create-shortcut.js b/Launch-Scripts/create-shortcut.js index 8a24baa2d..17e0567d8 100644 --- a/Launch-Scripts/create-shortcut.js +++ b/Launch-Scripts/create-shortcut.js @@ -5,7 +5,7 @@ const { exec } = require("child_process"); const os = require("os"); // Get the name of the main directory -let cwd = process.cwd(); +let cwd = __dirname; let dirs = cwd.split(path.sep); let name = dirs[dirs.length - 2]; @@ -49,22 +49,17 @@ if (os.platform() == "win32") { let version = os.version(); if (version.includes("Ubuntu")) { // Paths and Icon for Ubuntu shortcuts - let icon = path.join( process.cwd(),"..", "/Projects/Superalgos/Icons/superalgos.png"); - let shortcutPaths = [ - path.join( os.homedir(), "Desktop/" ), - path.join( os.homedir(), "local/share/applications/" ) - ] + let icon = path.join( __dirname,"..", "/Projects/Superalgos/Icons/superalgos.png"); // Create .desktop shortcut file - console.log("still working on linux", icon, shortcutPaths) fs.writeFileSync( `${name}.desktop`, `[Desktop Entry] Type=Application Encoding=UTF-8 Name=${name} Comment=Launch Shortcut for Superalgos - Path=${process.cwd()} - Exec=gnome-terminal -e ${process.cwd()}/launch-linux.sh + Path=${__dirname} + Exec=gnome-terminal -e ${__dirname}/launch-linux.sh Terminal=true Icon=${icon} Categories=Application;`, diff --git a/setup.js b/setup.js index 41c3fec1c..2f7860277 100644 --- a/setup.js +++ b/setup.js @@ -5,6 +5,7 @@ const { exec } = require("child_process"); // Handle adding shortcuts if (process.argv.includes("noShortcuts")) { // Cancel running script if flag provided + console.log(''); console.log('noShortcuts ................................................... Setting up without shortcuts.') } else {