Skip to content

Commit

Permalink
Removed global dependencies. Updated Start and Compile scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Caio Vaccaro authored and Caio Vaccaro committed May 30, 2016
1 parent 898c758 commit ce0e631
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
13 changes: 6 additions & 7 deletions Compile.app/Contents/Resources/script
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ compile() {
cd styleguide/structure/_node-files
node write-date-exec.js
cd ../../..
STYLEGUIDE_COMPILE=1 harp compile
STYLEGUIDE_COMPILE=1 ./styleguide/structure/_node-files/node_modules/.bin/harp compile
cd www
find . -type f -name "*.html" -exec js-beautify -r {} \;
find . -type f -name "*.js" -exec js-beautify -r {} \;
find . -type f -name "*.css" -exec js-beautify -r {} \;
find . -type f -name "*.html" -exec ../styleguide/structure/_node-files/node_modules/.bin/js-beautify -r {} \;
find . -type f -name "*.js" -exec ../styleguide/structure/_node-files/node_modules/.bin/js-beautify -r {} \;
find . -type f -name "*.css" -exec ../styleguide/structure/_node-files/node_modules/.bin/js-beautify -r {} \;
rm -rf AUTHORS.html Compile.app/ README.html CONTRIBUTING.html LICENSE.html Start.app/ livereload.js
echo "Done! Compiled HTML in the www folder."
echo "PROGRESS:100"
}

echo "Compiling Styleguide..."
echo ""
echo "PROGRESS:0"
type harp >/dev/null 2>&1
if [ $? -eq 1 ]
if [ ! -f ../../../styleguide/structure/_node-files/node_modules/.bin/harp ]
then
echo "Harp wasn't found, please run the Start file."
else
compile
fi

12 changes: 1 addition & 11 deletions Start.app/Contents/Resources/script
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ run() {
. .bashrc
cd "$PROJECT_PATH"
printf "\nChecking dependencies...\n\n"
type harp >/dev/null 2>&1
if [ $? -eq 1 ]
then
npm install harp -g
fi
type js-beautify >/dev/null 2>&1
if [ $? -eq 1 ]
then
npm install js-beautify -g
fi
cd ../../../styleguide/structure/_node-files
npm install
echo "PROGRESS:80"
Expand All @@ -57,7 +47,7 @@ createLockFile() {
}
. ~/.bashrc
echo "Styleguide. Welcome!"
cd ../../..
cd ../../..
if [ ! -f .install.lock ]; then
echo "PROGRESS:0"
type node >/dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion styleguide/_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
"styleguide": "Styleguide"
}
},
"date": "2016/3/21"
"date": "2016/5/30"
}
6 changes: 4 additions & 2 deletions styleguide/structure/_node-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "watch.js",
"dependencies": {
"livereload": "^0.3.6",
"watch": "^0.14.0"
"watch": "^0.14.0",
"harp": "0.20.3",
"js-beautify": "1.6.2"
},
"devDependencies": {
"blue-tape": "^0.1.10",
Expand All @@ -15,7 +17,7 @@
"tape": "^4.0.1"
},
"scripts": {
"build": "npm install | npm install -g harp",
"compile": "./node_modules/.bin/harp compile",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Huge",
Expand Down
2 changes: 1 addition & 1 deletion styleguide/structure/_node-files/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ portfinder.getPort(function (err, port) {
livereloader.start();

// Initialize Harp
exec('cd ' + utils.basePath + '&& harp server --port ' + PORT, utils.puts);
exec('cd ' + utils.basePath + '&& ./styleguide/structure/_node-files/node_modules/.bin/harp server --port ' + PORT, utils.puts);
if (!INTEGRATION_TEST) exec('echo "Starting Server on port ' + PORT + '.." && echo "PROGRESS:94"', utils.puts);
waitTheServer();
});
Expand Down

0 comments on commit ce0e631

Please sign in to comment.