mirror of
https://github.com/EvernodeXRPL/hp-devkit.git
synced 2026-04-29 15:37:58 +00:00
Added new contract templates (#31)
This commit is contained in:
26
docker/scripts/templates.sh
Normal file
26
docker/scripts/templates.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
cmd=$1
|
||||
|
||||
templates_dir="/code-templates"
|
||||
usage="Usage:
|
||||
\nlist <platform>"
|
||||
|
||||
if [ "$cmd" = "list" ]; then
|
||||
platform=$2
|
||||
|
||||
if [ ! -z $platform ]; then
|
||||
platforms=("$templates_dir/$platform")
|
||||
else
|
||||
platforms="$templates_dir/*"
|
||||
fi
|
||||
|
||||
for p in $platforms; do
|
||||
[ ! -d "$p" ] && echo "There are no templates for platform: ${p##*/}." && exit 0
|
||||
echo "$(tput bold)PLATFORM: ${p##*/}$(tput sgr0)"
|
||||
for t in $(ls -1 "$p"); do
|
||||
echo " $t"
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user