Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# This script helps initialize a new function project by
# replacing all instances of function-template-python with the
# name of your function. The script accepts two arguments:
# 1. The name of your function
# 2. The path to your function directory

set -e

cd "$2" || return

# Replace function-template-python with the name of your function
# in package/crossplane.yaml
perl -pi -e s,function-template-python,"$1",g package/crossplane.yaml
# in example YAML files
find example -type f -print0 | xargs -0 -I {} perl -pi -e s,function-template-python,"$1",g {}

echo "Function $1 has been initialized successfully"