Skip to content

Commit

Permalink
Create script that will generate symlink to cocos2d-x
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdukey committed Jul 31, 2014
1 parent d6667b6 commit 43cff0c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
Binary file removed .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Generated
ProgrammerGuideGame/cocos2d

# Mac system files
.DS_Store
.AppleDouble
.LSOverride
Expand Down
1 change: 0 additions & 1 deletion ProgrammerGuideGame/cocos2d

This file was deleted.

35 changes: 35 additions & 0 deletions ProgrammerGuideGame/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python
#coding=utf-8

import os
import traceback
from optparse import OptionParser

def main():
usage = "usage: %prog [options] arg"
parser = OptionParser(usage)
(options, args) = parser.parse_args()

# TODO: support pass cocos root from args
# if len(args) != 1:
# parser.error('Please specify cocos path')

# check if cocos2d-x exists
cocos_console_root = os.environ.get('COCOS_CONSOLE_ROOT')
if cocos_console_root is not None:
cocos_root = cocos_console_root
cocos_root = cocos_root.replace('/tools/cocos2d-console/bin','')

if cocos_root is None:
print('Failed to find cocos2d-x root')
sys.exit(1)

# create symbolic link to cocos2d-x
os.symlink(cocos_root, 'cocos2d')

if __name__ == '__main__':
try:
main()
except Exception as e:
traceback.print_exc()
sys.exit(1)
Empty file modified build.sh
100644 → 100755
Empty file.

0 comments on commit 43cff0c

Please sign in to comment.