Skip to content

Commit d1d6e19

Browse files
zjm-metameta-codesync[bot]
authored andcommitted
fix(scripts) Fix the 'build:tgz' failure on Windows.
Summary: QA reported that the build:tgz command is failing to execute on Windows for IWSDK. Investigated and fixed the Windows path issue to make the script working. Reviewed By: felixtrz Differential Revision: D87838279 fbshipit-source-id: 05f988f25e5e5bbb6b0b518179c5694564cdd1b9
1 parent 0b970c0 commit d1d6e19

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"build": "pnpm --filter '@iwsdk/core' run build",
88
"build:all": "pnpm -r run build",
9-
"build:tgz": "./scripts/build-tgz.sh",
9+
"build:tgz": "bash ./scripts/build-tgz.sh",
1010
"bundle:sdk": "bash ./scripts/build-sdk-bundle.sh",
1111
"docs:api": "typedoc && node scripts/postprocess-typedoc.cjs",
1212
"docs:dev": "vitepress dev docs",

scripts/build-tgz.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ set -e
1212
echo "🚀 Building standalone tgz packages..."
1313

1414
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
15+
UNAME=$(uname)
16+
if [[ "$UNAME" == CYGWIN* || "$UNAME" == MINGW* ]]; then
17+
# In windows, change base directory from '/c/Users/...' to 'C:/Users/...'
18+
BASE_DIR="${BASE_DIR:1:1}:${BASE_DIR:2}"
19+
BASE_DIR="${BASE_DIR^}"
20+
echo "Detected running on Windows, using $BASE_DIR as base directory"
21+
fi
1522
PACKAGES_DIR="$BASE_DIR/packages"
1623
EXAMPLES_DIR="$BASE_DIR/examples"
1724

0 commit comments

Comments
 (0)