[TIMOB-27866] CLI: ti clean with a forked SDK and --project-dir option exits with GracefulShutdown error
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2021-02-11T12:09:53.000+0000 |
| Affected Version/s | Release 9.0.0 |
| Fix Version/s | titanium 5.3.0 |
| Components | CLI |
| Labels | n/a |
| Reporter | Ewan Harris |
| Assignee | Ewan Harris |
| Created | 2020-04-27T17:16:28.000+0000 |
| Updated | 2021-02-11T12:10:00.000+0000 |
Description
*I'm still trying to figure this one out, but I think the title is the main bits at play*
Description
When calling clean like soti clean --project-dir <path> and the tiapp SDK version and selected SDK version do not match I'm seeing the CLI log an uncaughtError exception that appears to be due to the throw new cli.GracefulShutdown(); (I believe).
My current theories are as follows (update: both of these are wrong) :
* Some form of dependency update causing the instanceof check [here](https://github.com/appcelerator/titanium/blob/6a41ba410e51a7a3388e4d71c76508d89cac9836/lib/cli.js#L513) to fail because of how JS works with that kinda thing
* Possibly the async.js upgrade borking? Maybe it changed how throw works?
Steps to reproduce
1. Change your selected SDK (ti sdk select) and your tiapp SDK 2. Runti clean --project-dir <path>
logs
$titanium clean --project-dir /Users/awam/git/testing_apps/kitchensink-v2 [INFO] tiapp.xml <sdk-version> set to 8.3.0.GA , but current Titanium SDK set to 8.3.2 [INFO] Forking correct SDK command: "/Users/awam/.nvm/versions/node/v12.16.2/bin/node" "/Users/awam/git/titanium/bin/titanium" "clean" "--sdk" "8.3.0.GA" "--project-dir" "/Users/awam/git/testing_apps/kitchensink-v2" [LiveView] [GracefulShutdown [Error]] [DEBUG] Detecting plugins in /Users/awam/git/testing_apps/kitchensink-v2/plugins [DEBUG] Detected plugin: ti.alloy @ /Users/awam/git/testing_apps/kitchensink-v2/plugins/ti.alloy [DEBUG] Looking for Titanium plugin id= ti.alloy version= 1.0 [INFO] Found Titanium plugin id= ti.alloy version= 1.0 [DEBUG] Deleting all platform build directories [DEBUG] Resources directory of /Users/awam/git/testing_apps/kitchensink-v2/app has been emptied [INFO] Project cleaned successfully in 45msThis one was bugging me today so I took a look. I believe it's due to TIMOB-23247 (forking in ti clean never existed before this) and needs to be fixed by copying the
build.confighook in tisdk3fixes in titanium to aclean.confighookPR: https://github.com/appcelerator/titanium/pull/402