Skip to content

Instantly share code, notes, and snippets.

@adamreisnz
adamreisnz / release.sh
Last active April 13, 2024 17:01
A script to automate merging of release branches
#!/usr/bin/env bash
# Assuming you have a master and dev branch, and that you make new
# release branches named as the version they correspond to, e.g. 1.0.3
# Usage: ./release.sh 1.0.3
# Get version argument and verify
version=$1
if [ -z "$version" ]; then
echo "Please specify a version"
func wordRangeAtIndex(index:Int, inString str:NSString) -> NSRange {
let tagger = NSLinguisticTagger(tagSchemes: [NSLinguisticTagSchemeTokenType], options: 0)
var r : NSRange = NSMakeRange(0,0)
tagger.string = str as String
tagger.tagAtIndex(index, scheme: NSLinguisticTagSchemeTokenType, tokenRange: &r, sentenceRange: nil )
return r
}
func wordAtIndex(index:Int, inString str:NSString) -> NSString {
return str.substringWithRange(wordRangeAtIndex(index, inString: str))
@bclinkinbeard
bclinkinbeard / release.sh
Created November 1, 2011 20:22
Bash script to automate the Git Flow tag/release process
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# v1.0.0, v1.5.2, etc.
versionLabel=v$1
# establish branch and tag name variables
devBranch=develop