Skip to content

Instantly share code, notes, and snippets.

@wandernauta
Created November 25, 2012 18:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wandernauta/4144797 to your computer and use it in GitHub Desktop.
Save wandernauta/4144797 to your computer and use it in GitHub Desktop.
llamize
#!/bin/bash
#
# llamize
# Stub a llama-standard ooc library/binding.
#
# Check if a name is given.
if [[ -z $1 ]]; then
echo "Usage: llamize <name>"
exit
fi
# Check if the destination already exist. Bail if it does.
if [[ -e $1 ]]; then
echo "Error: $1 already exists."
exit
fi
# Find out the name of the project from the destination path.
n=$(basename $1)
# All is good, create directories and file stubs
mkdir "$1"
mkdir "$1/samples"
mkdir "$1/source"
mkdir "$1/source/$n"
touch "$1/$n.use"
touch "$1/README.md"
touch "$1/.gitignore"
touch "$1/.travis.yml"
# Fill templates
echo "## $n
### Authors
* Your Name Here
### Links
*
" > "$1/README.md"
echo "Name: $n
Version: 0.1
Description:
Pkgs:
Includes:
SourcePath: source
" > "$1/$n.use"
echo ".libs
rock_tmp
" > "$1/.gitignore"
echo "before_install:
- sudo aptitude -y -q install curl make libgc-dev
- git clone --depth=1 git://github.com/nddrylliog/rock.git
- (cd rock && make -s quick-rescue)
- export PATH=\$PATH:\$PWD/rock/bin
script:
- export OOC_LIBS=\$PWD
- cd samples
# - mkdir -p travis
# - rock -v example -o=travis/example && travis/example
" > "$1/.travis.yml"
echo "Done stubbing project $n."
@nddrylliog
Copy link

Just used it for https://github.com/nddrylliog/ooc-chipmunk - works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment