File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# https://stackoverflow.com/a/246128/294515
4
4
SOURCE=" ${BASH_SOURCE[0]} "
5
- while [ -h " $SOURCE " ]; do
5
+ while [ -L " $SOURCE " ]; do
6
6
DIR=" $( cd -P " $( dirname " $SOURCE " ) " > /dev/null 2>&1 && pwd ) "
7
7
SOURCE=" $( readlink " $SOURCE " ) "
8
8
[[ $SOURCE != /* ]] && SOURCE=" $DIR /$SOURCE "
9
9
done
10
10
DIR=" $( cd -P " $( dirname " $SOURCE " ) " > /dev/null 2>&1 && pwd ) "
11
+ DIR=" $( dirname $DIR ) "
11
12
12
- /usr/bin/env node " $DIR /../cli.js" " $@ "
13
+ # prefer using bun
14
+ if [ -x " $( command -v bun) " ]; then
15
+ CMD=bun
16
+ else
17
+ CMD=node
18
+ fi
19
+
20
+ /usr/bin/env $CMD " $DIR /cli.js" " $DIR " " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ let src1;
9
9
let src2 ;
10
10
let headerBody ;
11
11
12
- const args = process . argv . slice ( 2 ) ;
12
+ const args = process . argv . slice ( 3 ) ;
13
13
if ( args . length === 3 ) {
14
14
const [ path , rev1 , rev2 ] = args ;
15
15
src1 = execSync ( `git show ${ rev1 } :${ path } ` ) . toString ( ) ;
You can’t perform that action at this time.
0 commit comments