Skip to content

Instantly share code, notes, and snippets.

View BennettSmith's full-sized avatar
💭
Always learning!

Bennett Smith BennettSmith

💭
Always learning!
  • San Francisco Bay Area, CA
  • 06:23 (UTC -07:00)
View GitHub Profile
@BennettSmith
BennettSmith / xcode4_build.py
Created March 25, 2012 03:04 — forked from dsibilly/xcode4_build.py
Unique Build Numbers for XCode 4
# XCode 4 auto-versioning script for Git
# Inspired by the work of Axel Andersson, Marcus S. Zarra and Matt Long
# http://valthonis.net/u/19
"""
NOTE: Due to its use of build environment variables, this
script will only work from inside XCode's build process!
"""
import os
#!/bin/bash
# Create the script that emits values for a single file using stat.
cat >/tmp/fileperms.sh <<FILEPERMS
#!/bin/bash
echo chmod `stat -f '%Lp' \$1` \"\$1\"
echo chown `stat -f '%u' \$1`:`stat -f '%g' \$1` \"\$1\"
FILEPERMS
# Make sure the script is executable
def authorize_key_for_root(config, *key_paths)
[*key_paths, nil].each do |key_path|
if key_path.nil?
fail "Public key not found at following paths: #{key_paths.join(', ')}"
end
full_key_path = File.expand_path(key_path)
if File.exists?(full_key_path)
config.vm.provision 'file',