Merge branch 'Superalgos:develop' into develop

This commit is contained in:
B Harrell authored and GitHub committed 2021-06-18 21:31:41 -05:00
commit c321034d69
3 files changed
+67 -4

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/Client" # Location of package manifests
schedule:
interval: "daily"
+40 -2
View File
@@ -1,6 +1,6 @@
const path = require("path");
const fs = require("fs");
const { exec } = require("child_process");
const { exec, execSync } = require("child_process");
const os = require("os");
// Get the name of the main directory
@@ -92,7 +92,45 @@ if (os.platform() == "win32") {
// Mac Shortcuts
} else if (os.platform() == "darwin") {
console.log( "Automatic shortcut creation is not yet supported on Mac. If you would like to see this feature add, message @harrellbm on telegram or discord to ask how you can help!")
const icon = path.join( __dirname,"/superalgos.ico");
const createShortcutCommand = `chmod +x ${name}.command & cp ${name}.command ~/Desktop/${name}.command`
const installFileIconcommand = `npm install fileicon`;
const changeIconCommand = `./node_modules/fileicon/bin/fileicon set ~/Desktop/${name}.command ./Launch-Scripts/superalgos.ico`
const unInstallFileIconcommand = `npm uninstall fileicon`;
try {
// Create .desktop shortcut file
fs.writeFileSync( `${name}.command`,
`#!/bin/sh
cd ${__dirname}
cd ..
node run
"$SHELL"`,
);
// Place shortcut in proper folders
execSync( createShortcutCommand,{ timeout: 30000})
// Remove temporary .command file
fs.unlinkSync( `${name}.command` )
//Install fileicon utility
execSync(installFileIconcommand, {stdio: 'inherit', timeout: 30000});
//change Icon
execSync(changeIconCommand, {stdio: 'inherit', timeout: 30000});
//Un-Install fileicon utility
execSync(unInstallFileIconcommand, {stdio: 'inherit', timeout: 30000});
} catch (error) {
console.log('');
console.log("There was an error installing a shortcut: ");
console.log('');
console.log( error );
return;
}
console.log("Shortcuts added successfully!");
// Misc Operating System
} else {
+16 -2
View File
@@ -53,5 +53,19 @@ if (os.platform() == "win32") {
// Mac Shortcuts
} else if (os.platform() == "darwin") {
// Uninstall Mac shortcuts here once they have been added.
}
// Remove .desktop files
let command = `rm ~/Desktop/${name}.command`
exec( command,
function ( error, stdout ){
if (error) {
console.log('');
console.log("There was an error uninstalling shortcuts: ");
console.log('');
console.log( error );
return;
} else {
console.log('');
console.log("Shortcuts have been uninstalled successfully.");
}
});
}