This repository has been archived by the owner on Oct 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to choose output for xcode images
- Loading branch information
1 parent
d315c24
commit 8721e02
Showing
1 changed file
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,14 @@ var _ = require('underscore'); | |
var Q = require('q'); | ||
var argv = require('minimist')(process.argv.slice(2)); | ||
|
||
/** | ||
* @var {Object} settings - names of the config file and of the icon image | ||
*/ | ||
var settings = {}; | ||
settings.CONFIG_FILE = argv.config || 'config.xml'; | ||
settings.ICON_FILE = argv.icon || 'icon.png'; | ||
settings.OLD_XCODE_PATH = argv['xcode-old'] || false; | ||
|
||
/** | ||
* Check which platforms are added to the project and return their icon names and sizes | ||
* | ||
|
@@ -16,11 +24,17 @@ var argv = require('minimist')(process.argv.slice(2)); | |
var getPlatforms = function (projectName) { | ||
var deferred = Q.defer(); | ||
var platforms = []; | ||
var xcodeFolder = '/Images.xcassets/AppIcon.appiconset/'; | ||
|
||
if (settings.OLD_XCODE_PATH) { | ||
xcodeFolder = '/Resources/icons/'; | ||
} | ||
|
||
platforms.push({ | ||
name : 'ios', | ||
// TODO: use async fs.exists | ||
isAdded : fs.existsSync('platforms/ios'), | ||
iconsPath : 'platforms/ios/' + projectName + '/Resources/icons/', | ||
iconsPath : 'platforms/ios/' + projectName + xcodeFolder, | ||
icons : [ | ||
{ name : 'icon-40.png', size : 40 }, | ||
{ name : '[email protected]', size : 80 }, | ||
|
@@ -59,7 +73,7 @@ var getPlatforms = function (projectName) { | |
name : 'osx', | ||
// TODO: use async fs.exists | ||
isAdded : fs.existsSync('platforms/osx'), | ||
iconsPath : 'platforms/osx/' + projectName + '/Images.xcassets/AppIcon.appiconset/', | ||
iconsPath : 'platforms/osx/' + projectName + xcodeFolder, | ||
icons : [ | ||
{ name : 'icon-16x16.png', size : 16 }, | ||
{ name : 'icon-32x32.png', size : 32 }, | ||
|
@@ -116,14 +130,6 @@ var getPlatforms = function (projectName) { | |
return deferred.promise; | ||
}; | ||
|
||
|
||
/** | ||
* @var {Object} settings - names of the config file and of the icon image | ||
*/ | ||
var settings = {}; | ||
settings.CONFIG_FILE = argv.config || 'config.xml'; | ||
settings.ICON_FILE = argv.icon || 'icon.png'; | ||
|
||
/** | ||
* @var {Object} console utils | ||
*/ | ||
|