You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-13 22:12:50 +02:00
Added script to install app locally
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
require('source-map-support').install();
|
require('source-map-support').install();
|
||||||
require('babel-plugin-transform-runtime');
|
require('babel-plugin-transform-runtime');
|
||||||
|
|
||||||
|
18
CliClient/app/main.sh
Normal file
18
CliClient/app/main.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Because all the files in the "lib" directory are included as "lib/file.js" it
|
||||||
|
# means "lib" must be in NODE_PATH, however modifying the global NODE_PATH
|
||||||
|
# variable would be messy. So instead, the path is set temporarily just before running
|
||||||
|
# the app. To do this, this bash wrapper is needed (also a messy solution, but node
|
||||||
|
# path resolution is messy anyway). See https://gist.github.com/branneman/8048520
|
||||||
|
|
||||||
|
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
|
||||||
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
|
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||||
|
CLIENT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
SOURCE="$(readlink "$SOURCE")"
|
||||||
|
[[ $SOURCE != /* ]] && SOURCE="$CLIENT_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||||
|
done
|
||||||
|
CLIENT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
|
NODE_PATH="$CLIENT_DIR:$NODE_PATH" node "$CLIENT_DIR/main.js"
|
5
CliClient/build.sh
Normal file
5
CliClient/build.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
rm -f "$CLIENT_DIR/app/lib"
|
||||||
|
ln -s "$CLIENT_DIR/../lib" "$CLIENT_DIR/app"
|
9
CliClient/install.sh
Normal file
9
CliClient/install.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
bash $CLIENT_DIR/build.sh
|
||||||
|
cp "$CLIENT_DIR/package.json" build/
|
||||||
|
cp "$CLIENT_DIR/../lib/package.json" build/lib
|
||||||
|
cp "$CLIENT_DIR/app/main.sh" build/
|
||||||
|
cd "$CLIENT_DIR/build"
|
||||||
|
sudo npm install -g --save
|
||||||
|
cd -
|
@@ -1,8 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "CliClient",
|
"name": "joplin-cli",
|
||||||
"version": "0.0.1",
|
"version": "0.8.0",
|
||||||
"private": true,
|
"bin": {
|
||||||
|
"joplin": "./main.sh"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"babel-plugin-transform-runtime": "^6.23.0",
|
||||||
|
"source-map-support": "^0.4.15",
|
||||||
"app-module-path": "^2.2.0",
|
"app-module-path": "^2.2.0",
|
||||||
"form-data": "^2.1.4",
|
"form-data": "^2.1.4",
|
||||||
"fs-extra": "^3.0.1",
|
"fs-extra": "^3.0.1",
|
||||||
@@ -27,12 +31,10 @@
|
|||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "^6.24.1",
|
||||||
"babel-plugin-syntax-async-functions": "^6.1.4",
|
"babel-plugin-syntax-async-functions": "^6.1.4",
|
||||||
"babel-plugin-transform-regenerator": "^6.1.4",
|
"babel-plugin-transform-regenerator": "^6.1.4",
|
||||||
"babel-plugin-transform-runtime": "^6.23.0",
|
|
||||||
"babel-polyfill": "^6.1.4",
|
"babel-polyfill": "^6.1.4",
|
||||||
"babel-preset-env": "^1.5.1",
|
"babel-preset-env": "^1.5.1",
|
||||||
"babel-preset-es2015": "^6.1.4",
|
"babel-preset-es2015": "^6.1.4",
|
||||||
"babel-preset-react": "^6.24.1",
|
"babel-preset-react": "^6.24.1",
|
||||||
"source-map-support": "^0.4.15",
|
|
||||||
"jasmine": "^2.6.0"
|
"jasmine": "^2.6.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
bash $CLIENT_DIR/build.sh
|
||||||
rm -f "$CLIENT_DIR/app/lib"
|
|
||||||
ln -s "$CLIENT_DIR/../lib" "$CLIENT_DIR/app"
|
|
||||||
|
|
||||||
npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/main.js
|
npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/main.js
|
||||||
#npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/test-onedrive.js
|
|
||||||
#npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/onedrive-server.js
|
|
Reference in New Issue
Block a user