Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-17636] Create Titanium SDK folder if it doesn't exist #183

Merged
merged 2 commits into from Jan 27, 2015

Conversation

skypanther
Copy link
Contributor

@@ -1391,7 +1392,11 @@ SetupScreens.prototype.sdk = function sdk(callback) {
ignoreFiles: new RegExp(this._config.get('cli.ignoreFiles')),
validate: function (value) {
if (value && (!fs.existsSync(afs.resolvePath(value) || fs.statSync(value).isDirectory()))) {
throw new Error(__('Invalid directory'));
if (!fs.existsSync(afs.resolvePath(value))) {
wrench.mkdirSyncRecursive(value);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to do a permissions check before we attempt to create a directory. Otherwise, users might end up something like this :

Path to find and install Titanium SDKs:
[/Users/pinnamuri/Library/Application Support/Titanium]: /Library/Application Support/Titanium
[ERROR] EACCES, permission denied '/Library/Application Support/Titanium'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node-appc already has a function to check write permissions:

afs.isFileWritable(file);

afs.isDirWritable(dir);

@pinnamur
Copy link

CR and FR passed.

pinnamur pushed a commit that referenced this pull request Jan 27, 2015
[TIMOB-17636] Create Titanium SDK folder if it doesn't exist
@pinnamur pinnamur merged commit cd0dd4a into tidev:master Jan 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants