13 lines
462 B
Bash
Executable file
13 lines
462 B
Bash
Executable file
#!/bin/sh
|
|
chartName=$1
|
|
if [ -z ${chartName} ]; then
|
|
echo "chart-name required"
|
|
echo "create.sh <chart-name>"
|
|
exit 1;
|
|
fi
|
|
templatePath="$(dirname "$0")"
|
|
chartPath="${templatePath}/../${chartName}"
|
|
chartPath="$(realpath "${chartPath}")"
|
|
echo "${chartName} under ${chartPath} (based on ${templatePath})"
|
|
cp -r "${templatePath}" "${chartPath}"
|
|
find "$chartPath" \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/<template>/${chartName}/g"
|