Skip to content

Commit

Permalink
chore: applied lint fixes from shelljs removal changes
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed May 20, 2020
1 parent a90d4fc commit b0f383f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bin/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const fs = require('fs-extra');
* @returns {void}
*/
exports.replaceFileContents = function (file, searchRegex, replacementString) {
// let contents;
let contents;
try {
var contents = fs.readFileSync(file).toString();
contents = fs.readFileSync(file).toString();
} catch (ex) {
console.log('TRYING TO READ: ', file);
throw ex;
Expand All @@ -54,9 +54,9 @@ exports.replaceFileContents = function (file, searchRegex, replacementString) {
* @returns string|null
*/
exports.grep = function (file, regex) {
let contents = fs.readFileSync(file).toString().replace(/\\r/g, '').split('\n');
const contents = fs.readFileSync(file).toString().replace(/\\r/g, '').split('\n');
for (let i = 0; i < contents.length; i++) {
let line = contents[i];
const line = contents[i];
if (regex.test(line)) {
return line;
}
Expand Down
1 change: 0 additions & 1 deletion bin/templates/scripts/cordova/lib/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
const Q = require('q');
const path = require('path');
const fs = require('fs-extra');
const shell = require('shelljs');
const superspawn = require('cordova-common').superspawn;

const projectPath = path.join(__dirname, '..', '..');
Expand Down
6 changes: 3 additions & 3 deletions tests/spec/unit/build.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ describe('build', () => {
return buildRequire.findXCodeProjectIn(fakePath).then(
() => {},
(error) => {
expect(error).toBe(`No Xcode project found in ${fakePath}`)
expect(error).toBe(`No Xcode project found in ${fakePath}`);
}
);
});
Expand All @@ -424,7 +424,7 @@ describe('build', () => {
return buildRequire.findXCodeProjectIn(fakePath).then(
(projectName) => {
expect(events.emit).toHaveBeenCalledWith(jasmine.any(String), jasmine.stringMatching(/Found multiple .xcodeproj directories in/));
expect(projectName).toBe('Test1')
expect(projectName).toBe('Test1');
}
);
});
Expand All @@ -434,7 +434,7 @@ describe('build', () => {
return buildRequire.findXCodeProjectIn(fakePath).then(
(projectName) => {
expect(events.emit).not.toHaveBeenCalled();
expect(projectName).toBe('Test1')
expect(projectName).toBe('Test1');
}
);
});
Expand Down

0 comments on commit b0f383f

Please sign in to comment.