File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ hash npm 2> /dev/null || { echo >&2 " npm not found, exiting." ; }
5
+
6
+ cd $( cd ${0%/* } && pwd -P) ;
7
+
8
+ versions=( " $@ " )
9
+ if [ ${# versions[@]} -eq 0 ]; then
10
+ versions=( * / )
11
+ fi
12
+ versions=( " ${versions[@]%/ } " )
13
+
14
+ npmVersion=" $( npm show npm version 2> /dev/null) "
15
+ for version in " ${versions[@]} " ; do
16
+ fullVersion=" $( curl -sSL --compressed ' http://nodejs.org/dist' | grep ' <a href="v' " $version ." | sed -E ' s!.*<a href="v([^"/]+)/?".*!\1!' | cut -f 3 -d . | sort -n | tail -1) "
17
+ (
18
+ sed -E -i.bak '
19
+ s/^(ENV NPM_VERSION) .*/\1 ' " $npmVersion " ' /;
20
+ ' " $version /Dockerfile" " $version /slim/Dockerfile" " $version /wheezy/Dockerfile"
21
+ rm $version /Dockerfile.bak $version /slim/Dockerfile.bak $version /wheezy/Dockerfile.bak
22
+ )
23
+ done
Original file line number Diff line number Diff line change @@ -11,13 +11,11 @@ if [ ${#versions[@]} -eq 0 ]; then
11
11
fi
12
12
versions=( " ${versions[@]%/ } " )
13
13
14
- npmVersion=" $( npm show npm version 2> /dev/null) "
15
14
for version in " ${versions[@]} " ; do
16
15
fullVersion=" $( curl -sSL --compressed ' http://nodejs.org/dist' | grep ' <a href="v' " $version ." | sed -E ' s!.*<a href="v([^"/]+)/?".*!\1!' | cut -f 3 -d . | sort -n | tail -1) "
17
16
(
18
17
sed -E -i.bak '
19
18
s/^(ENV NODE_VERSION) .*/\1 ' " $version .$fullVersion " ' /;
20
- s/^(ENV NPM_VERSION) .*/\1 ' " $npmVersion " ' /;
21
19
' " $version /Dockerfile" " $version /slim/Dockerfile" " $version /wheezy/Dockerfile"
22
20
rm $version /Dockerfile.bak $version /slim/Dockerfile.bak $version /wheezy/Dockerfile.bak
23
21
You can’t perform that action at this time.
0 commit comments