{ "id": "173130", "key": "ALOY-1652", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "20671", "description": "Alloy items that will be included in CLI 7.1.0", "name": "CLI Release 7.1.0", "archived": false, "released": true, "releaseDate": "2019-08-13" }, { "id": "20836", "name": "Alloy 1.14.0", "archived": false, "released": true, "releaseDate": "2019-07-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-06-19T15:22:49.000+0000", "created": "2019-03-14T17:47:17.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shaig", "key": "shaig", "displayName": "Samuel Haig", "active": true, "timeZone": "Europe/London" }, "updated": "2019-06-19T15:22:50.000+0000", "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" } }, "components": [ { "id": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "description": "h5.Description\r\n\r\nCurrently if an expected directory or file doesn't exist the alloy new command doesn't handle this very well and will just throw an error directly from node.\r\n\r\nWe should handle these errors properly and log errors informing a user what file is missing.\r\n\r\nFor example (this is just one example, there are probably more)\r\n\r\n1. Create a titanium project using {{ti create}} or {{appc new --classic}}\r\n2. {{cd}} into that dir\r\n3. Call {{alloy new . ~/Documents}}\r\n\r\n{code}\r\nfs.js:119\r\n throw err;\r\n ^\r\n\r\nError: ENOENT: no such file or directory, lstat '/Users/eharris/Documents/app'\r\n at Object.lstatSync (fs.js:861:3)\r\n at /Users/eharris/Documents/git/alloy/node_modules/graceful-fs/polyfills.js:297:22\r\n at getStats (/Users/eharris/Documents/git/alloy/node_modules/fs-extra/lib/copy-sync/copy-sync.js:46:14)\r\n at startCopy (/Users/eharris/Documents/git/alloy/node_modules/fs-extra/lib/copy-sync/copy-sync.js:41:10)\r\n at Object.copySync (/Users/eharris/Documents/git/alloy/node_modules/fs-extra/lib/copy-sync/copy-sync.js:36:10)\r\n at module.exports (/Users/eharris/Documents/git/alloy/Alloy/commands/new/index.js:113:5)\r\n at Object. (/Users/eharris/Documents/git/alloy/Alloy/alloy.js:112:46)\r\n at Module._compile (internal/modules/cjs/loader.js:799:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)\r\n at Module.load (internal/modules/cjs/loader.js:666:32)\r\n at tryModuleLoad (internal/modules/cjs/loader.js:606:12)\r\n at Function.Module._load (internal/modules/cjs/loader.js:598:3)\r\n at Module.require (internal/modules/cjs/loader.js:705:19)\r\n at require (internal/modules/cjs/helpers.js:14:16)\r\n at Object. (/Users/eharris/Documents/git/alloy/bin/alloy:3:1)\r\n at Module._compile (internal/modules/cjs/loader.js:799:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)\r\n at Module.load (internal/modules/cjs/loader.js:666:32)\r\n at tryModuleLoad (internal/modules/cjs/loader.js:606:12)\r\n at Function.Module._load (internal/modules/cjs/loader.js:598:3)\r\n at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)\r\n at internal/main/run_main_module.js:21:11\r\n{code}\r\n\r\n\r\nThat error should be handled correctly and we should log an error informing the user what is missing. We might wish to have a canned message on all messages saying something to the effect of \"your template must have x, y and x\".\r\n\r\nIt would also be good to clear up the {{app}} directory created so that a user doesn't have to do this manually", "attachment": [], "flagged": false, "summary": "CLI: Improve handling of missing directories and files in alloy new", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": null, "closedSprints": [ { "id": 1123, "state": "closed", "name": "2019 Sprint 7", "startDate": "2019-03-18T17:27:25.993Z", "endDate": "2019-03-30T17:27:00.000Z", "completeDate": "2019-03-29T18:02:37.441Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "449202", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*, Fix verified in CLI Version {{7.1.0-master.21}} Able to see better handling of missing directories and files in {{alloy new}}. Tested using the the test steps in the description and able to see the following error: \r\n\r\n{code:java}\r\n[ERROR] Project creation failed. \r\n[ERROR] Project template \"/Users/Samir/Documents\" not found at \"/usr/local/lib/node_modules/alloy/templates/Users/Samir/Documents\"\r\n{code}\r\n\r\n*Test Environment*\r\n{code:java}\r\nSDK: 8.0.2.GA\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.14.4\r\n Architecture = 64bit\r\n CPUs = 8\r\n Memory = 16.0GB\r\nNode.js\r\n Node.js Version = 10.13.0\r\n npm Version = 6.4.1\r\nAppcelerator CLI\r\n Installer = 4.2.14-3\r\n Core Package = 7.1.0-master.21\r\nTitanium CLI\r\n CLI Version = 5.2.1\r\n node-appc Version = 0.2.49\r\n{code}", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-19T15:22:32.000+0000", "updated": "2019-06-19T15:22:32.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }