Permalink
Browse files

Appveyor fix

  • Loading branch information...
1 parent c93a8a6 commit a0b5c4b813671b2f1dfdabfcbd7dbde7f72236a9 @bitwiseman bitwiseman committed Feb 1, 2016
Showing with 13 additions and 7 deletions.
  1. +1 −1 appveyor.yml
  2. +6 −1 js/lib/cli.js
  3. +6 −5 js/test/shell-smoke-test.sh
View
@@ -1,4 +1,4 @@
-version: 1.6.0+{build}
+version: 1.6+{build}
nuget:
disable_publish_on_pr: true
View
@@ -155,7 +155,12 @@ function findRecursive(dir, fileName) {
}
function getUserHome() {
- return process.env.USERPROFILE || process.env.HOME;
+ var user_home = '';
+ try {
+ user_home = process.env['USERPROFILE'] || process.env['HOME'] || '';
+ } catch (ex) {
+ }
+ return user_home;
}
// var cli = require('js-beautify/cli'); cli.interpret();
@@ -155,11 +155,12 @@ test_cli_js_beautify()
cleanup 1
}
- export HOME=
- export USERPROFILE=
- $CLI_SCRIPT -o $TEST_TEMP/example1-default.js $SCRIPT_DIR/resources/example1.js
+ unset HOME
+ unset USERPROFILE
+ $CLI_SCRIPT -o $TEST_TEMP/example1-default.js $SCRIPT_DIR/resources/example1.js || exit 1
- $CLI_SCRIPT $TEST_TEMP/example1-default.js | diff -q $TEST_TEMP/example1-default.js - || {
+ $CLI_SCRIPT -o $TEST_TEMP/example1-sanity.js $TEST_TEMP/example1-default.js || exit 1
+ diff -q $TEST_TEMP/example1-default.js $TEST_TEMP/example1-sanity.js || {
echo "js-beautify output for $TEST_TEMP/example1-default.js was expected to be identical after no change in settings."
cleanup 1
}
@@ -191,7 +192,7 @@ test_cli_js_beautify()
$CLI_SCRIPT -o $TEST_TEMP/example1-indent11chars.js $TEST_TEMP/example1-default.js
- export HOME=
+ unset HOME
export USERPROFILE=$SCRIPT_DIR/resources/indent11chars
$CLI_SCRIPT $TEST_TEMP/example1-default.js | diff -q $TEST_TEMP/example1-indent11chars.js - || {
echo "js-beautify output for $TEST_TEMP/example1-default.js was expected to be identical for same HOME and USERPROFILE settings."

0 comments on commit a0b5c4b

Please sign in to comment.