File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -190,12 +190,21 @@ function binary-task() {
190
190
log " Binary: ${buildPath} /${binaryName} "
191
191
}
192
192
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
+
193
202
# Check if it looks like we are inside VS Code.
194
203
function in-vscode () {
195
204
local dir=" ${1} " ; shift
196
205
local maybeVsCode
197
206
local dirName
198
- maybeVsCode=" $( realpath " ${dir} /../../.." ) "
207
+ maybeVsCode=" $( absolute-path " ${dir} /../../.." ) "
199
208
dirName=" $( basename " ${maybeVsCode} " ) "
200
209
if [[ " ${dirName} " != " vscode" ]] ; then
201
210
return 1
@@ -213,7 +222,7 @@ function main() {
213
222
local relativeRootPath
214
223
local rootPath
215
224
relativeRootPath=" $( dirname " ${0} " ) /.."
216
- rootPath=" $( realpath " ${relativeRootPath} " ) "
225
+ rootPath=" $( absolute-path " ${relativeRootPath} " ) "
217
226
218
227
local task=" ${1} " ; shift
219
228
if [[ " ${task} " == " ensure-in-vscode" ]] ; then
You can’t perform that action at this time.
0 commit comments