Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacwhite committed Mar 19, 2019
1 parent 4483dec commit d6e49a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/install_customizations
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
if [[ -f ./.env ]];
then
echo "sourcing env vars"
echo "sourcing environment variables from .env"
source ./.env
fi

echo "Checking for CUSTOMIZATION_GIT_REPO environment variable..."
if ! [[ -z ${CUSTOMIZATION_GIT_REPO} ]];
then
echo "Cloning custom repo...";
# remove cusotm to allow for cloning to that directory name
# remove custom to allow for cloning to that directory name
rm -r ./custom;
git clone $CUSTOMIZATION_GIT_REPO custom;
echo "Installing custom packages...";
Expand Down
7 changes: 4 additions & 3 deletions bin/update_gae_pkg
Expand Up @@ -4,20 +4,21 @@ const fs = require('fs')
const path = require('path')

const pkgPath = path.join(__dirname, '../package.json')
// load the custom pkg json
// load the custom/package.json
let customPkg = { dependencies: {} }
try {
customPkg = require('../custom/package.json')
} catch (err) {
console.warn('Could not load custom Pkg, aborting', err)
process.exit(1)
console.warn('Could not load custom package.json, will use default Library config', err)
}
// load the normal pkg json
const pkg = require(pkgPath)

const {dotenv} = pkg.devDependencies

// update the start config to use .env, add as normal dep
pkg.scripts.start = `node -r dotenv/config server/index`
pkg.dependencies = Object.assign({}, pkg.dependencies, {dotenv}, customPkg.dependencies)

// write the updates package.json to disk
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4))

0 comments on commit d6e49a6

Please sign in to comment.