{ "id": "133189", "key": "TIMOB-17332", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-07-15T13:24:41.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "cb-tooling", "cli" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [ { "id": "46068", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "inwardIssue": { "id": "142995", "key": "TIMOB-18396", "fields": { "summary": "CLI: Analytics - CLI analytic events are not sent if you pass --url flag multiple times", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2020-02-05T23:55:58.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10207", "name": "Tooling" } ], "description": "Execute the following:\r\n\r\n{code}\r\nti build -p ios --project-dir . --project-dir ./\r\n{code}\r\n\r\nAnd you will get:\r\n\r\n{code}\r\n/usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:185\r\n throw e;\r\n ^\r\nTypeError: Arguments to path.join must be strings\r\n at path.js:360:15\r\n at Array.filter (native)\r\n at exports.join (path.js:358:36)\r\n at exports.resolvePath (/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/node-appc/lib/fs.js:52:20)\r\n at conf.options.appc.util.mix.project-dir.validate (/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/cli/commands/build.js:132:27)\r\n at CLI. (/usr/local/lib/node_modules/titanium/lib/cli.js:622:14)\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:551:21\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:227:13\r\n at iterate (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:134:13)\r\n at async.eachSeries (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:150:9)\r\n---------------------------------------------\r\n at run (/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/node-appc/lib/subprocess.js:59:8)\r\n at /Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/iphone/cli/lib/detect.js:356:9\r\n at /Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/async/lib/async.js:511:21\r\n at /Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/async/lib/async.js:227:13\r\n at /Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/async/lib/async.js:111:13\r\n at Array.forEach (native)\r\n at _each (/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/async/lib/async.js:32:24)\r\n at async.each (/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/3.3.0.RC2/node_modules/async/lib/async.js:110:9)\r\n{code}\r\n\r\nWhy would you want to use the same options twice?\r\n\r\na) Because you can.\r\nb) Because this can happen if you use build tools like TiShadow adding options instead of replacing them.\r\n\r\nWhat it should do?\r\n\r\n* Use the last value", "attachment": [], "flagged": false, "summary": "CLI: Using same option twice with different values causes crash", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "CLI 3.3.0-rc4\r\nSDK 3.3.0.RC2", "comment": { "comments": [ { "id": "314170", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Thanks for your report! The priority will be set by the platform team. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-07-15T16:40:46.000+0000", "updated": "2014-07-15T16:40:46.000+0000" }, { "id": "314176", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I think it's worthy to fix, but tools shouldn't be blindly tacking on repeating values :)", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-07-15T16:44:41.000+0000", "updated": "2014-07-15T16:44:41.000+0000" }, { "id": "314203", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "I believe if an option is encountered multiple times, the Titanium CLI argument parser will convert the option value into an array of values: https://github.com/appcelerator/titanium/blob/master/lib/context.js#L609.\r\n\r\nWe need to either:\r\n\r\n1. Overwrite duplicate values instead of creating an array of values\r\n2. Update nearly all option callbacks detect an array and use the last value\r\n\r\nI *HIGHLY* recommend option #2. It's pretty easy since each option has a callback that is called when the parser encounters the value. I believe we'd need to update nearly all of the options to do this, but it will allow the most flexibility when the time comes that we want to cleanly support multiple values.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-07-15T17:37:49.000+0000", "updated": "2014-07-15T17:37:49.000+0000" }, { "id": "314232", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm fine with option 2.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-07-15T18:45:55.000+0000", "updated": "2014-07-15T18:45:55.000+0000" }, { "id": "404087", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "I wasn't able to reproduce this using the example {{ti build -p ios \\-\\-project-dir . \\-\\-project-dir ./}}, but that's because the resolved path for both project dirs are the same. However, if they are different, then you will get the error above.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-01-04T16:31:50.000+0000", "updated": "2017-01-04T16:31:50.000+0000" }, { "id": "454076", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "This won't be an issue in Titanium CLI.next.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2020-02-05T23:55:58.000+0000", "updated": "2020-02-05T23:55:58.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }