Commit Graph

9 Commits

Author SHA1 Message Date
Felix Rabe
3431c66c16 Fix occurrences of "cd dirname $0"
They are not safe for spaces in paths. There might be other places to look for trouble.

I've run the following command to produce this commit: (on OS X, copy-and-pasting the below exactly)

    find . -type f -name '*.sh' -print0  |  # Find all .sh files
        xargs -0 fgrep -H -- '`'         |  # See all places with backticks in them
        fgrep 'cd `dirname $0'           |  # I deemed these problematic (variable assignments are safe)
        cut -d ':' -f 1                  |  # Take the <file> from <file>:<line> produced by "grep -H"
        tr '\n' '\0'                     |  # Also here, spaces can be problematic - always do "xargs -0"!
        xargs -0 -- sed -i '' 's/cd `dirname $0`/cd "`dirname "$0"`"/g'

The significance of adding the two levels of "'s can be verified by running the following in your Terminal:

    $ node -e 'console.log(process.argv.splice(1))' -- `echo 1   2`
    [ '1', '2' ]

    $ node -e 'console.log(process.argv.splice(1))' -- "`echo 1   2`"
    [ '1 2' ]

    $ node -e 'console.log(process.argv.splice(1))' -- "`echo "1   2"`"
    [ '1   2' ]
2014-05-07 17:51:09 -07:00
Geoff Schmidt
e1994f6ece First installment of 'meteor run' tests.
Tests meteor --once and restarting on upgrade.
2014-01-29 02:02:17 -08:00
David Glasser
5c366a34fe build arch-specific packages, which contain NPM modules! 2013-03-29 11:52:33 -07:00
David Glasser
db2037978c make build-tools-tree more set-e/u 2013-03-21 11:33:42 -07:00
David Glasser
570b3567f9 meteor-bootstrap.sh -> launch-meteor 2013-03-19 23:49:44 -07:00
David Glasser
b7bec5a391 update scripts because --version exits 1 2013-03-19 20:22:01 -07:00
David Glasser
257f5b8c2d this time with more backslash 2013-03-19 18:19:52 -07:00
David Glasser
5583dc12ed shrink tools version to 10 chars 2013-03-19 18:19:45 -07:00
David Glasser
8a79edb43b "tools" -> "scripts", "engine" -> "tools" 2013-03-19 18:19:31 -07:00