Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support mutliple sketch files and pass in Asset group as 3rd arg #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def info(self):

# parse arguments

if not len(sys.argv) == 3:
print "Proper usage: python slice.py [.sketch file] [.xcassets file]"
if not len(sys.argv) == 4:
print "Proper usage: python slice.py [.sketch file] [.xcassets file] Group"
exit(1)

INPUT_FILE = os.path.abspath(sys.argv[1])
Expand All @@ -108,9 +108,14 @@ def info(self):
if not ASSETS_FILE.endswith('.xcassets'):
print "Output file is expected to be a .xcassets bundle"
exit(1)

ASSETS_GROUP = sys.argv[3]
if not ASSETS_GROUP:
ASSETS_GROUP = "Slices"


EXPORT_DIR = os.path.join(os.path.dirname(INPUT_FILE), 'tmp_exported_slices')
OUTPUT_DIR = os.path.join(ASSETS_FILE, 'Slices')
OUTPUT_DIR = os.path.join(ASSETS_FILE, ASSETS_GROUP)
OUTPUT_INFO_PATH = os.path.join(OUTPUT_DIR, 'info.json')

# check to see if the sketch file has been modified
Expand Down