Skip to content

Instantly share code, notes, and snippets.

@sergioalvz
Forked from dgsuarez/new_hg_gem.sh
Last active August 29, 2015 14:06
Show Gist options
  • Save sergioalvz/f5c67da192695e10e460 to your computer and use it in GitHub Desktop.
Save sergioalvz/f5c67da192695e10e460 to your computer and use it in GitHub Desktop.
Uses Mercurial instead of Git in a gem generated by "bundle gem" but removes the spec, test and features files from the *.gemspec
#! /bin/sh
set -e
bundle gem $1
cd $1
rm -rf .git
mv .gitignore .hgignore
sed -i -e "1s/^/syntax: glob\n/" .hgignore
sed -i 's|git ls-files -z.*|hg manifest -q\`.split("\\n")\.reject\{ \|x\| x =~ /^(test\|spec\|features)\/ }|' $1.gemspec
sed -i '/spec.test_files/d' $1.gemspec
hg init
hg addremove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment