Skip to content

Commit 3044afe

Browse files
Merge pull request #1318 from cypherstack/fix/windows-cygpath
Use cygpath on Windows CI, fall back to wslpath for WSL
2 parents 9220445 + b069115 commit 3044afe

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

scripts/app_config/shared/asset_generators.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ pushd "${APP_PROJECT_ROOT_DIR}"
1414
YAML_FILE="${APP_PROJECT_ROOT_DIR}/scripts/app_config/platforms/${APP_BUILD_PLATFORM}/flutter_launcher_icons.yaml"
1515
if [[ "${APP_BUILD_PLATFORM}" = 'windows' ]]; then
1616
cmd.exe /c flutter pub get
17-
WIN_PATH_VERSION=$(wslpath -w ${YAML_FILE})
17+
if command -v cygpath >/dev/null 2>&1; then
18+
WIN_PATH_VERSION=$(cygpath -w "${YAML_FILE}")
19+
else
20+
WIN_PATH_VERSION=$(wslpath -w "${YAML_FILE}")
21+
fi
1822
cmd.exe /c dart run flutter_launcher_icons -f "${WIN_PATH_VERSION}"
1923
# not needed in windows
2024
# cmd.exe /c dart run flutter_native_splash:create

scripts/app_config/shared/link_assets.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ for dirname in "default_themes" "icon" "lottie" "in_app_logo_icons" "svg"; do
2323
rm -f "${ASSETS_DIR}/${dirname}"
2424

2525
if [[ "${APP_BUILD_PLATFORM}" = 'windows' ]]; then
26-
LINK_SOURCE_DIR_WIN_PATH_VERSION=$(wslpath -w "${LINK_SOURCE_DIR}")
27-
LINK_NAME_WIN_PATH_VERSION=$(wslpath -w "${ASSETS_DIR}")
26+
if command -v cygpath >/dev/null 2>&1; then
27+
LINK_SOURCE_DIR_WIN_PATH_VERSION=$(cygpath -w "${LINK_SOURCE_DIR}")
28+
LINK_NAME_WIN_PATH_VERSION=$(cygpath -w "${ASSETS_DIR}")
29+
else
30+
LINK_SOURCE_DIR_WIN_PATH_VERSION=$(wslpath -w "${LINK_SOURCE_DIR}")
31+
LINK_NAME_WIN_PATH_VERSION=$(wslpath -w "${ASSETS_DIR}")
32+
fi
2833
cmd.exe /c mklink /D "${LINK_NAME_WIN_PATH_VERSION}\\${dirname}" "${LINK_SOURCE_DIR_WIN_PATH_VERSION}"
2934
else
3035
ln -s "${LINK_SOURCE_DIR}" "${ASSETS_DIR}/${dirname}"

0 commit comments

Comments
 (0)