[package.json] added electron build commands + dependencies [install.sh] linux installation script (/usr/share/applications)

This commit is contained in:
xdrm-brackets 2018-04-10 10:27:39 +02:00
parent 066cae054e
commit 95d3487820
2 changed files with 31 additions and 2 deletions

25
install.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# 1. Get + Go to current directory
ROOT="`realpath $(dirname $0)`";
cd $ROOT;
# 2. Install npm dependencies
echo -e "[1/3] installing dependencies";
npm --prefix=$ROOT install;
# 3. Build electron-app
echo -e "[2/3] building electron app";
npm --prefix=$ROOT run build:electron;
# 4. Create launching application
echo -e "[3/3] creating application shorcut";
DESKTOP_APP="[Desktop Entry]\n";
DESKTOP_APP+="Name=Douscord\n";
DESKTOP_APP+="GenericName=Douscord\n"
DESKTOP_APP+="Exec=/bin/bash -c 'cd /home/xdrm-brackets/ubuntu/git.xdrm.io/discord/client/; npm run electron;'\n";
DESKTOP_APP+="Terminal=false\n";
DESKTOP_APP+="Type=Application\n";
DESKTOP_APP+="Categories=Chat;Audio;Messages;Communication\n";
echo -e "$DESKTOP_APP" | sudo tee /usr/share/applications/douscord.desktop > /dev/null && echo ">>> INSTALLATION SUCCESSFUL <<<" || echo ">>> CANNOT CREATE SHORTUT <<<";

View File

@ -7,13 +7,16 @@
"private": true, "private": true,
"scripts": { "scripts": {
"clean": "rm ./public_html/*.html; rm ./public_html/*.js; rm ./public_html/*.css; rm ./public_html/*svg; rm ./public_html/*.map; exit 0", "clean": "rm ./public_html/*.html; rm ./public_html/*.js; rm ./public_html/*.css; rm ./public_html/*svg; rm ./public_html/*.map; exit 0",
"clean:electron": "rm -r ./electron-build; exit 0",
"dev": "parcel watch ./parcel/index.html --out-dir ./public_html --no-hmr", "dev": "parcel watch ./parcel/index.html --out-dir ./public_html --no-hmr",
"build:alternative": "cross-env NODE_ENV=production parcel watch ./parcel/index.html --out-dir ./public_html --no-hmr", "build:alternative": "cross-env NODE_ENV=production parcel watch ./parcel/index.html --out-dir ./public_html --no-hmr",
"build": "parcel build ./parcel/index.html --out-dir ./public_html --no-source-maps --no-minify", "build": "parcel build ./parcel/index.html --public-url ./ --out-dir ./public_html --no-source-maps --no-minify",
"build:electron": "parcel build ./parcel/index.html --out-dir ./public_html --no-source-maps --no-minify --target electron" "build:electron": "parcel build ./parcel/index.html --public-url ./ --out-dir ./electron-build --no-source-maps --no-minify --target=electron",
"electron": "electron ./electron-build/index.html"
}, },
"dependencies": { "dependencies": {
"vue": "^2.5.9", "vue": "^2.5.9",
"vue-hot-reload-api": "^2.3.0",
"vue-router": "^2.5.3" "vue-router": "^2.5.3"
}, },
"browserslist": [ "browserslist": [
@ -28,6 +31,7 @@
"babel-preset-env": "^1.6.0", "babel-preset-env": "^1.6.0",
"babel-preset-stage-3": "^6.24.1", "babel-preset-stage-3": "^6.24.1",
"cross-env": "^5.0.5", "cross-env": "^5.0.5",
"electron": "^1.8.4",
"node-sass": "^4.8.3", "node-sass": "^4.8.3",
"parcel-bundler": "^1.7.0", "parcel-bundler": "^1.7.0",
"vue-template-compiler": "^2.5.16" "vue-template-compiler": "^2.5.16"