Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#getting user input for name
namecap="$(tr '[:lower:]' '[:upper:]' <<< ${name:0:1})${name:1}"
#making sure user provided a name
if [ $# -eq 0 ]
printf "Please provide a name for your new application\ne.g. ./ sensorapp\n"
#downloading switch example to use as base for application
echo Creating new application: $name
git clone $name
#renaming files and folders
mv $name/Switch $name/$namecap
mv $name/$namecap/switch.c $name/$namecap/$name.c
#configuring makefile
sed -i "s/switch/$name/g" $name/$namecap/Makefile $name/Makefile
sed -i "s/Switch/$namecap/g" $name/Makefile
#adding new application to feed
cd ../creator-sdk
./scripts/feeds update -a && ./scripts/feeds install -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment