Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Add support for xx-npm to nodejs/vue2/buildpack
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 authored Jun 26, 2023
1 parent 194f2d6 commit 46292aa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nodejs/vue2/buildpack
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/sh
set -e

NPM_BIN=yarn

if [ "$(command -v xx-npm)" ]; then
NPM_BIN=xx-npm
fi

# Build Vue.js project with Docker Buildx Bake
#
# Docker Metadata Actions
Expand All @@ -25,16 +31,12 @@ fi

pre_build() {
echo "=> Executing pre-build script"
# echo "- Installing https://github.com/google/zx"
echo
# npm install -g zx
}

post_build() {
echo "=> Executing post-build script"
# echo "- Uninstall https://github.com/google/zx"
echo
# npm uninstall -g zx
}

build() {
Expand Down Expand Up @@ -63,7 +65,7 @@ build() {
echo "- DOCKER_META_VERSION=${DOCKER_META_VERSION}"
echo

yarn run build --mode ${BUILD_MODE} "$@"
$NPM_BIN run build --mode ${BUILD_MODE} "$@"
}

# RUN
Expand Down

0 comments on commit 46292aa

Please sign in to comment.