Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17669] CLI: Running "ti build -p iOS -T device -deploy-type " with invalid iOS build option should give an error message rather than showing a code error.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.4.0
Fix Version/sn/a
ComponentsCLI
Labelscb-tooling, qe-3.4.0
ReporterKhushbu Agrawal
AssigneeChris Barber
Created2014-09-10T08:24:13.000+0000
Updated2020-01-30T08:52:57.000+0000

Description

Description: Running "ti build -p iOS -T device -deploy-type" command throws a code error rather than giving a appropriate error message to user for given invalid option. The"-deploy-type" is not a valid option.The valid form with build is "--deploy-type". The error is reproducible with CLI 3.3.0 and Titanium SDK 3.3.0.GA.So its not a regression. STEPS TO REPRODUCE 1. Open a terminal window 2. Create a project and you have to "cd" to this project to be able to run command "build". 3. Run "ti build -p iOS -T device -deploy-type" command. 4. Run "ti build -p iOS -T device -build-only" command. EXPECTED RESULT 3. The CLI should give appropriate error message for invalid option use rather than showing a code error. ACTUAL RESULT 3.The CLI shows a code error to the user.

KAGRAWAL-MBP:classic_test kagrawal$ ti build -p ios -T device -deploy-type
[ERROR] TypeError: Arguments to path.join must be strings
    at path.js:360:15
    at Array.filter (native)
    at exports.join (path.js:358:36)
    at conf.options.appc.util.mix.project-dir.callback (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/cli/commands/build.js:111:52)
    at Context.<anonymous> (/usr/local/lib/node_modules/titanium/lib/context.js:597:31)
    at Array.forEach (native)
    at Context.setArg (/usr/local/lib/node_modules/titanium/lib/context.js:576:35)
    at Context.<anonymous> (/usr/local/lib/node_modules/titanium/lib/context.js:675:9)
    at Context.parse (/usr/local/lib/node_modules/titanium/lib/context.js:758:6)
    at processConf (/usr/local/lib/node_modules/titanium/lib/context.js:364:21)
---------------------------------------------
    at Object.run (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/node-appc/lib/subprocess.js:59:8)
    at async.eachSeries.cache (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/lib/simulator.js:186:21)
    at iterate (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/node_modules/async/lib/async.js:149:13)
    at /Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/node_modules/async/lib/async.js:160:25
    at /Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/lib/simulator.js:227:7
    at ChildProcess.<anonymous> (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/node-appc/lib/subprocess.js:60:3)
    at EventEmitter.emit (events.js:98:17)
KAGRAWAL-MBP:classic_test kagrawal$ ti build -p ios -build-only
[ERROR] Error: tiapp.xml file does not exist
    at Object.defineProperty.value (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/titanium-sdk/lib/tiappxml.js:649:11)
    at new tiapp (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/titanium-sdk/lib/tiappxml.js:723:19)
    at conf.options.appc.util.mix.project-dir.callback (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/cli/commands/build.js:111:34)
    at Context.<anonymous> (/usr/local/lib/node_modules/titanium/lib/context.js:597:31)
    at Array.forEach (native)
    at Context.setArg (/usr/local/lib/node_modules/titanium/lib/context.js:576:35)
    at Context.<anonymous> (/usr/local/lib/node_modules/titanium/lib/context.js:675:9)
    at Context.parse (/usr/local/lib/node_modules/titanium/lib/context.js:754:6)
    at processConf (/usr/local/lib/node_modules/titanium/lib/context.js:364:21)
    at Context.<anonymous> (/usr/local/lib/node_modules/titanium/lib/context.js:536:5)
---------------------------------------------
    at Object.run (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/node-appc/lib/subprocess.js:59:8)
    at async.eachSeries.cache (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/lib/simulator.js:186:21)
    at iterate (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/node_modules/async/lib/async.js:149:13)
    at /Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/node_modules/async/lib/async.js:160:25
    at /Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/ioslib/lib/simulator.js:227:7
    at ChildProcess.<anonymous> (/Users/kagrawal/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.v20140909222515/node_modules/node-appc/lib/subprocess.js:60:3)
    at EventEmitter.emit (events.js:98:17)

Comments

  1. Khushbu Agrawal 2014-09-11

    This need to be fixed with other invalid options as well. ti build -p iOS -developer-name => Shows the CLI version (valid option is --developer-name) ti build -p iOS -device-id => Shows the CLI version (valid option is --device-id) Not sure about expected CLI behavior with iOS build invalid option with build command.

JSON Source