Skip to content

Instantly share code, notes, and snippets.

@DianthuDia
Created January 9, 2019 14:40
Show Gist options
  • Save DianthuDia/ad77792813e10d665c819fee951e916b to your computer and use it in GitHub Desktop.
Save DianthuDia/ad77792813e10d665c819fee951e916b to your computer and use it in GitHub Desktop.
CocosCreator v2.0.1
cask 'cocoscreator' do
version '2.0.1,20180823'
sha256 '1738ace990ff863f0cc757e949b27c513625d71827c0c6ecda1a97b0e12b0e47'
# download.cocos.com was verified as official when first introduced to the cask
url "https://digitalocean.cocos2d-x.org/CocosCreator/v#{version.before_comma}/CocosCreator_v#{version.before_comma}_#{version.after_comma}.dmg"
name 'CocosCreator'
homepage 'http://www.cocos2d-x.org/'
# shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
shimscript = "#{staged_path}/cocos.wrapper.sh"
app 'CocosCreator.app'
binary shimscript, target: 'cocos'
preflight do
IO.write shimscript, <<~EOS
#!/bin/sh
cd '#{appdir}/CocosCreator.app/Contents/Resources/cocos2d-x/tools/cocos2d-console/bin' && ./cocos "$@"
EOS
end
zap trash: [
'~/Library/Application Support/CocosCreator',
'~/Library/Preferences/com.cocos.creator.plist',
'~/Library/Preferences/com.cocos.apps.simulator.plist',
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment