File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,12 +190,21 @@ function binary-task() {
190190 log " Binary: ${buildPath} /${binaryName} "
191191}
192192
193+ function absolute-path() {
194+ local relative=" ${1} " ; shift
195+ if command -v realpath & > /dev/null ; then
196+ realpath " ${relative} "
197+ else
198+ readlink -f " ${relative} "
199+ fi
200+ }
201+
193202# Check if it looks like we are inside VS Code.
194203function in-vscode () {
195204 local dir=" ${1} " ; shift
196205 local maybeVsCode
197206 local dirName
198- maybeVsCode=" $( realpath " ${dir} /../../.." ) "
207+ maybeVsCode=" $( absolute-path " ${dir} /../../.." ) "
199208 dirName=" $( basename " ${maybeVsCode} " ) "
200209 if [[ " ${dirName} " != " vscode" ]] ; then
201210 return 1
@@ -213,7 +222,7 @@ function main() {
213222 local relativeRootPath
214223 local rootPath
215224 relativeRootPath=" $( dirname " ${0} " ) /.."
216- rootPath=" $( realpath " ${relativeRootPath} " ) "
225+ rootPath=" $( absolute-path " ${relativeRootPath} " ) "
217226
218227 local task=" ${1} " ; shift
219228 if [[ " ${task} " == " ensure-in-vscode" ]] ; then
You can’t perform that action at this time.
0 commit comments