Skip to content

Commit

Permalink
Avoid the use of readlink -f in shell scripts
Browse files Browse the repository at this point in the history
This doesn't work on macOS. Replacement taken from:
https://serverfault.com/a/406371
  • Loading branch information
foolip committed Oct 20, 2018
1 parent b96f5e4 commit 3432729
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 22 deletions.
3 changes: 1 addition & 2 deletions css/build-css-testsuites.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env sh
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/..)
WPT_ROOT=$(cd $(dirname "$0")/.. && pwd -P)
cd $WPT_ROOT

main() {
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_built_diff.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

main() {
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

mkdir -p ~/meta
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_manifest.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

mkdir -p ~/meta
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_resources_unittest.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

source tools/ci/lib.sh
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_stability.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

source tools/ci/lib.sh
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_tools_unittest.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

run_applicable_tox () {
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_wpt.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -e

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

source tools/ci/lib.sh
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/ci_wptrunner_infrastructure.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

source tools/ci/lib.sh
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

if [[ $RUN_JOB -eq 1 ]]; then
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
WPT_ROOT=$(cd $(dirname "$0")/../.. && pwd -P)
cd $WPT_ROOT

if [[ $RUN_JOB -eq 1 ]]; then
Expand Down

0 comments on commit 3432729

Please sign in to comment.