Skip to content

Commit

Permalink
Normalize on cd+dirname+pwd for resolving paths
Browse files Browse the repository at this point in the history
Signed-off-by: Jose A. Rivera <[email protected]>
  • Loading branch information
jarrpa committed Aug 22, 2017
1 parent 82a3699 commit ab09787
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion deploy/gk-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

PROG="$(basename "${0}")"
SCRIPT_DIR="$(dirname "${0}")"
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
TOPOLOGY='topology.json'
LOG_FILE=''
VERBOSE=0
Expand Down
2 changes: 1 addition & 1 deletion tests/complex/lib.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# honor variables set from the caller:
: "${TEST_DIR="$(dirname "${0}")"}"
: "${TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"}"
: "${BASE_DIR="${TEST_DIR}/../.."}"
: "${VAGRANT_DIR="${BASE_DIR}/vagrant"}"
: "${DEPLOY_DIR="${BASE_DIR}/deploy"}"
Expand Down
2 changes: 1 addition & 1 deletion tests/complex/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# shellcheck disable=SC2034
TESTNAME=""
TEST_DIR="$(dirname "${0}")"
TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"

source "${TEST_DIR}/lib.sh"

Expand Down
2 changes: 1 addition & 1 deletion tests/complex/test-dynamic-provisioning.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

TEST_DIR="$(dirname "${0}")"
TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"
DOCKER_IMAGE="gcr.io/google_containers/nginx-slim:0.8"

source "${TEST_DIR}/lib.sh"
Expand Down
2 changes: 1 addition & 1 deletion tests/complex/test-gk-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

TEST_DIR="$(dirname "${0}")"
TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"

source "${TEST_DIR}/lib.sh"

Expand Down
2 changes: 1 addition & 1 deletion tests/complex/test-setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

TEST_DIR="$(dirname "${0}")"
TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"

source "${TEST_DIR}/lib.sh"

Expand Down
2 changes: 1 addition & 1 deletion tests/complex/test-teardown.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

TEST_DIR="$(dirname "${0}")"
TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"

source "${TEST_DIR}/lib.sh"

Expand Down
2 changes: 1 addition & 1 deletion tests/simple/gk-deploy/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "${0}")"
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"

echo "running tests in ${SCRIPT_DIR}"

Expand Down
2 changes: 1 addition & 1 deletion tests/simple/gk-deploy/test_gk_deploy_basic.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "${0}")"
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
STUBS_DIR="${SCRIPT_DIR}/stubs"
TESTS_DIR="${SCRIPT_DIR}/.."
INC_DIR="${TESTS_DIR}/common"
Expand Down
2 changes: 1 addition & 1 deletion tests/simple/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "${0}")"
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"

failed=0

Expand Down
2 changes: 1 addition & 1 deletion tests/simple/shell/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR=$(cd "$(dirname "${0}")" || exit 1; pwd)
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"

echo "running tests in ${SCRIPT_DIR}"

Expand Down
2 changes: 1 addition & 1 deletion tests/simple/shell/test_realpath.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR=$(cd "$(dirname "${0}")" || exit 1; pwd)
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
TESTS_DIR="${SCRIPT_DIR}/.."
INC_DIR="${TESTS_DIR}/common"
BASE_DIR="${SCRIPT_DIR}/../../.."
Expand Down
2 changes: 1 addition & 1 deletion tests/simple/shell/test_syntax.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR=$(cd "$(dirname "${0}")" || exit 1; pwd)
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
TESTS_DIR="${SCRIPT_DIR}/.."
INC_DIR="${TESTS_DIR}/common"
BASE_DIR="${SCRIPT_DIR}/../../.."
Expand Down
2 changes: 1 addition & 1 deletion tests/simple/yaml/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "${0}")"
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"

echo "running tests in ${SCRIPT_DIR}"

Expand Down
2 changes: 1 addition & 1 deletion tests/simple/yaml/test_syntax.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "${0}")"
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
TESTS_DIR="${SCRIPT_DIR}/.."
INC_DIR="${TESTS_DIR}/common"
BASE_DIR="${SCRIPT_DIR}/../../.."
Expand Down
2 changes: 1 addition & 1 deletion vagrant/demo/demo-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEMO_DIR="$(dirname "${0}")"
DEMO_DIR="$(cd "$(dirname "${0}")" && pwd)"
VAGRANT_DIR="${DEMO_DIR}/.."

. "${DEMO_DIR}/util.sh"
Expand Down
2 changes: 1 addition & 1 deletion vagrant/demo/demo-dynamic-provisioning.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEMO_DIR="$(dirname "${0}")"
DEMO_DIR="$(cd "$(dirname "${0}")" && pwd)"
VAGRANT_DIR="${DEMO_DIR}/.."

cd "${VAGRANT_DIR}" || exit 1
Expand Down
2 changes: 1 addition & 1 deletion vagrant/demo/demo-inside-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEMO_DIR="$(dirname "${0}")"
DEMO_DIR="$(cd "$(dirname "${0}")" && pwd)"
VAGRANT_DIR="${DEMO_DIR}/.."
SSH_CONFIG=${DEMO_DIR}/ssh-config

Expand Down
2 changes: 1 addition & 1 deletion vagrant/demo/demo-prepare.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEMO_DIR="$(dirname "${0}")"
DEMO_DIR="$(cd "$(dirname "${0}")" && pwd)"
VAGRANT_DIR="${DEMO_DIR}/.."
DEPLOY_DIR="${VAGRANT_DIR}/../deploy"
SSH_CONFIG="${DEMO_DIR}/ssh-config"
Expand Down
2 changes: 1 addition & 1 deletion vagrant/demo/demo-status.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEMO_DIR="$(dirname "${0}")"
DEMO_DIR="$(cd "$(dirname "${0}")" && pwd)"
VAGRANT_DIR="${DEMO_DIR}/.."

cd "${VAGRANT_DIR}" || exit 1
Expand Down
2 changes: 1 addition & 1 deletion vagrant/demo/demo-test-heketi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEMO_DIR="$(dirname "${0}")"
DEMO_DIR="$(cd "$(dirname "${0}")" && pwd)"
VAGRANT_DIR="${DEMO_DIR}/.."

cd "${VAGRANT_DIR}" || exit 1
Expand Down

0 comments on commit ab09787

Please sign in to comment.