File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env sh
2
- # code-server.sh -- Run code-server with the bundled Node binary.
2
+ # Runs code-server with the bundled Node binary.
3
3
4
- dir=" $( dirname " $( readlink -f " $0 " || realpath " $0 " ) " ) "
4
+ # More complicated than readlink -f or realpath to support macOS.
5
+ # See https://github.com/cdr/code-server/issues/1537
6
+ get_installation_dir () {
7
+ # We read the symlink, which may be relative from $0.
8
+ dst=" $( readlink " $0 " ) "
9
+ # We cd into the $0 directory.
10
+ cd " $( dirname " $0 " ) "
11
+ # Now we can cd into the dst directory.
12
+ cd " $( dirname " $dst " ) "
13
+ # Finally we use pwd -P to print the absolute path of the directory of $dst.
14
+ pwd -P
15
+ }
5
16
17
+ dir=$( get_installation_dir)
6
18
exec " $dir /node" " $dir /out/node/entry.js" " $@ "
You can’t perform that action at this time.
0 commit comments