mirror of
https://github.com/hahow/common-chart.git
synced 2026-08-24 03:46:15 +00:00
refactor: portable sed -i
This commit is contained in:
+11
-1
@@ -10,11 +10,21 @@ fi
|
||||
|
||||
CHART_NAME=$1
|
||||
|
||||
case $(sed --help 2>&1) in
|
||||
*GNU*)
|
||||
SED=(sed -i)
|
||||
;;
|
||||
|
||||
*)
|
||||
SED=(sed -i "")
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Creating chart..."
|
||||
mkdir "$CHART_NAME"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://codeload.github.com/hahow/common-chart/tar.gz/master | \
|
||||
tar -xz -C "$CHART_NAME" --strip=2 common-chart-master/starter
|
||||
find "$CHART_NAME" -type f | xargs sed -i "" "s/<CHARTNAME>/$CHART_NAME/g"
|
||||
find "$CHART_NAME" -type f | xargs "${SED[@]}" "s/<CHARTNAME>/$CHART_NAME/g"
|
||||
|
||||
echo "Building dependencies..."
|
||||
helm dep build "$CHART_NAME"
|
||||
|
||||
Reference in New Issue
Block a user