From c820989ac6992813473b694d5591e3bf5059cda7 Mon Sep 17 00:00:00 2001 From: James Thomas Date: Fri, 15 Dec 2017 18:03:09 +0000 Subject: [PATCH] node version of local sdk script --- .../{local_sdk_prepare.js => local_sdk.js} | 4 ++-- helpers/local_sdk.sh | 20 ------------------- helpers/local_sdk_symlink.js | 7 ------- package.json | 2 +- 4 files changed, 3 insertions(+), 30 deletions(-) rename helpers/{local_sdk_prepare.js => local_sdk.js} (59%) delete mode 100644 helpers/local_sdk.sh delete mode 100644 helpers/local_sdk_symlink.js diff --git a/helpers/local_sdk_prepare.js b/helpers/local_sdk.js similarity index 59% rename from helpers/local_sdk_prepare.js rename to helpers/local_sdk.js index a4eaebe..74b29c1 100644 --- a/helpers/local_sdk_prepare.js +++ b/helpers/local_sdk.js @@ -1,7 +1,7 @@ 'use strict'; const path = require('path'); -const localSdk = require(path.join(process.env.BB_SDK_SRC_DIR, 'bespoke-gulp-tasks', 'helpers', 'local_sdk.js')); +const localSDK = require(path.join(process.env.BB_SDK_SRC_DIR, 'bespoke-gulp-tasks', 'helpers', 'local_sdk.js')); const projectRootPath = path.join(__dirname, '..'); -localSdk.prepare(projectRootPath); +localSDK.link(projectRootPath); diff --git a/helpers/local_sdk.sh b/helpers/local_sdk.sh deleted file mode 100644 index f4f6566..0000000 --- a/helpers/local_sdk.sh +++ /dev/null @@ -1,20 +0,0 @@ -if [ -d 'tmp' ]; then - rm -rf ./tmp -fi - -mkdir 'tmp' - -if [ -d 'node_modules' ]; then - rm -rf ./node_modules/bookingbug-angular - mv ./node_modules ./tmp/node_modules -fi - -node ./helpers/local_sdk_prepare.js # create tmp/package.json that refers relatively to local sdk - -cd ./tmp -npm install --global-style --no-package-lock -cd .. - -mv ./tmp/node_modules ./node_modules - -node ./helpers/local_sdk_symlink \ No newline at end of file diff --git a/helpers/local_sdk_symlink.js b/helpers/local_sdk_symlink.js deleted file mode 100644 index ccbe603..0000000 --- a/helpers/local_sdk_symlink.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const path = require('path'); -const localSdk = require(path.join(process.env.BB_SDK_SRC_DIR, 'bespoke-gulp-tasks', 'helpers', 'local_sdk.js')); -const projectRootPath = path.join(__dirname, '..'); - -localSdk.symlink(projectRootPath); diff --git a/package.json b/package.json index dbd1ead..e29296c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "scripts": { "i": "rm -rf ./node_modules/bookingbug-angular package-lock.json && npm install --global-style --no-package-lock", - "il": "sh ./helpers/local_sdk.sh", + "il": "node ./helpers/local_sdk.js", "p": "gulp --root public", "p-dev": "gulp --root public --env development", "p-staging": "gulp --root public --env staging",