[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-20 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-lib/pull/597


---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-20 Thread stevengill
Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/597#discussion_r146039059
  
--- Diff: src/plugman/init-defaults.js ---
@@ -55,25 +55,26 @@ function readDeps (test) {
 };
 }
 
-var name = pkg.name || defaults.id || basename;
+/* eslint-disable */
--- End diff --

Do you need this `/* eslint-disable */`


---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-20 Thread stevengill
Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/597#discussion_r146038992
  
--- Diff: .eslintignore ---
@@ -1,4 +1 @@
-spec/cordova/fixtures/**
-spec/plugman/projects/**
-spec/plugman/plugins/**
-spec/cordova/temp/**
+**/init-defaults.js
--- End diff --

Why did you remove the other items from `.eslintignore`?


---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-20 Thread stevengill
Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/597#discussion_r146039159
  
--- Diff: src/plugman/init-defaults.js ---
@@ -149,10 +149,11 @@ if (!pkg.author) {
 }
 : prompt('author');
 }
-/* eslint-enable indent */
-var license = pkg.license ||
+var license = package.license ||
   defaults.license ||
   config.get('init.license') ||
   config.get('init-license') ||
   'ISC';
+/* eslint-enable */
--- End diff --

is this needed? `/* eslint-enable */`


---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-20 Thread OminousWater
GitHub user OminousWater reopened a pull request:

https://github.com/apache/cordova-lib/pull/597

CB-13451 (all platforms) "pkg not defined" exception when running plugman 
with createpackagejson command-line

A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused 
references to the global 'package' variable in init-default.js to be renamed to 
'pkg’, presumably because the cordova-lib source doesn’t declare a global 
variable called ‘package’ but _does_ declare a global variable called 
‘pkg’ (in src/cordova/info.js). However in this case, the ‘package’ 
variable refers to the one declared in the plugman source, specifically 
main.js, so it should have stayed as 'package’. To test the fix, run:

plugman createpackagejson .

Without the fix, this will trigger the following exception: 'pkg is not 
defined'. Having patched in the fix, running the command line should work as 
expected, prompting the user with questions and then spitting out a 
package.json file.



### Platforms affected
All

### What does this PR do?
Fixes an bug where an exception would be thrown when running 'plugman 
createpackagejson .'

### What testing has been done on this change?
The command in question ('plugman createpackagejson .') has been tested 
with and without the fix to confirm that the fix fixes the problem.

### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
- [ ] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/OminousWater/cordova-lib master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/597.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #597


commit e321bc319b94c86b77d993981491f99bac6f27f9
Author: Roland 
Date:   2017-10-16T20:57:59Z

Fix for 'pkg is not defined' exception
A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused 
references to the global 'package' variable in init-default.js to be renamed to 
'pkg’, presumably because the cordova-lib source doesn’t declare a global 
variable called ‘package’ but _does_ declare a global variable called 
‘pkg’ (in cordova/info.js). However in this case, the ‘package’ 
variable refers to the one declared in the plugman source, specifically 
main.js, so it should have stayed as 'package’. To test the fix, run:

plugman createpackagejson .

Without the fix, this will trigger the following exception: 'pkg is not 
defined'. Having patched in the fix, running the command line should work as 
expected, prompting the user with questions and then spitting out a 
package.json file.

commit 91614eb341735fde77661f3643c9a328fd09ac0c
Author: Roland 
Date:   2017-10-18T19:45:23Z

Revert "Fix for 'pkg is not defined' exception"

This reverts commit e321bc319b94c86b77d993981491f99bac6f27f9.

commit 62c5d2631c56ed40fda0576bc726b61bc0eb7806
Author: Roland 
Date:   2017-10-19T20:45:23Z

Second attempt at fix for CB-13451

commit f3dec27bfe9e4e6dce2f8d5ef6d3997c1ca2b925
Author: Roland 
Date:   2017-10-20T07:00:32Z

Make eslint ignore init-defaults.js file(s) as it will fail otherwise on 
'package' keword that PromZard injects




---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-16 Thread OminousWater
Github user OminousWater closed the pull request at:

https://github.com/apache/cordova-lib/pull/597


---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...

2017-10-16 Thread OminousWater
GitHub user OminousWater opened a pull request:

https://github.com/apache/cordova-lib/pull/597

CB-13451 (all platforms) "pkg not defined" exception when running plugman 
with createpackagejson command-line

A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused 
references to the global 'package' variable in init-default.js to be renamed to 
'pkg’, presumably because the cordova-lib source doesn’t declare a global 
variable called ‘package’ but _does_ declare a global variable called 
‘pkg’ (in src/cordova/info.js). However in this case, the ‘package’ 
variable refers to the one declared in the plugman source, specifically 
main.js, so it should have stayed as 'package’. To test the fix, run:

plugman createpackagejson .

Without the fix, this will trigger the following exception: 'pkg is not 
defined'. Having patched in the fix, running the command line should work as 
expected, prompting the user with questions and then spitting out a 
package.json file.



### Platforms affected
All

### What does this PR do?
Fixes an bug where an exception would be thrown when running 'plugman 
createpackagejson .'

### What testing has been done on this change?
The command in question ('plugman createpackagejson .') has been tested 
with and without the fix to confirm that the fix fixes the problem.

### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
- [ ] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/OminousWater/cordova-lib master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/597.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #597


commit e321bc319b94c86b77d993981491f99bac6f27f9
Author: Roland 
Date:   2017-10-16T20:57:59Z

Fix for 'pkg is not defined' exception
A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused 
references to the global 'package' variable in init-default.js to be renamed to 
'pkg’, presumably because the cordova-lib source doesn’t declare a global 
variable called ‘package’ but _does_ declare a global variable called 
‘pkg’ (in cordova/info.js). However in this case, the ‘package’ 
variable refers to the one declared in the plugman source, specifically 
main.js, so it should have stayed as 'package’. To test the fix, run:

plugman createpackagejson .

Without the fix, this will trigger the following exception: 'pkg is not 
defined'. Having patched in the fix, running the command line should work as 
expected, prompting the user with questions and then spitting out a 
package.json file.




---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org