Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var Logging = IonicAppLib.logging;
var log = Logging.logger;
var Q = require('q');
var helpUtil = require('./utils/help');
var EOL = require('os').EOL;

Cli.ALL_TASKS = Tasks;
Cli.IONIC_DASH = 'https://apps.ionic.io';
Expand Down Expand Up @@ -268,7 +269,7 @@ Cli.loadGulpfile = function loadGulpfile() {
var names = ['gulpfile.js', 'Gulpfile.js'];
for (var i = 0, ii = names.length; i < ii; i += 1) {
try {
require(path.resolve(process.cwd() + '/' + names[i]));
require(path.resolve(process.cwd(), names[i]));
log.verbose('Gulpfile found');
return true;
} catch (e) {
Expand Down Expand Up @@ -327,7 +328,7 @@ Cli.runNpmHook = function runNpmHook(hook) {
log.error('Unable to run spawn command ' + err);
});
spawned.stdout.on('data', function(data) {
var dataLines = data.toString().split('\n');
var dataLines = data.toString().split(EOL);
for (var i = 0; i < dataLines.length; i++) {
if (dataLines[i].length) {
log.info(dataLines[i]);
Expand Down Expand Up @@ -355,7 +356,7 @@ Cli.loadNpmScripts = function loadNpmScripts() {
var fileName = 'package.json';

try {
var packageFile = require(path.resolve(process.cwd() + '/' + fileName));
var packageFile = require(path.resolve(process.cwd(), fileName));
log.verbose('Package.json found scripts:', packageFile.scripts);
return packageFile.scripts;
} catch (e) {
Expand Down
7 changes: 4 additions & 3 deletions lib/utils/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var IonicAppLib = require('ionic-app-lib');
var log = IonicAppLib.logging.logger;
var EOL = require('os').EOL;
require('colors');

/**
Expand Down Expand Up @@ -173,7 +174,7 @@ function printTaskDetails(d) {
}
w((indent + ' ' + arg + ' ').bold);

var argDescs = d.args[arg].split('\n');
var argDescs = d.args[arg].split(EOL);
var argIndent = indent + ' ';

for (x = 0; x < arg.length + 1; x += 1) {
Expand Down Expand Up @@ -218,9 +219,9 @@ function printTaskDetails(d) {
var optDescs;

if (typeof taskOpt == 'string') {
optDescs = taskOpt.split('\n');
optDescs = taskOpt.split(EOL);
} else {
optDescs = taskOpt.title.split('\n');
optDescs = taskOpt.title.split(EOL);
}
for (x = 0; x < optDescs.length; x += 1) {
if (x === 0) {
Expand Down
3 changes: 2 additions & 1 deletion spec/utils/templates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var rewire = require('rewire');
var templateUtils = rewire('../../lib/utils/templates');
var IonicAppLib = require('ionic-app-lib');
var log = IonicAppLib.logging.logger;
var EOL = require('os').EOL;

describe('listTemplates method', function() {
it('should should call fetchStarterTemplates pull out templates/sort and send to list', function(done) {
Expand Down Expand Up @@ -148,7 +149,7 @@ describe('list function', function() {
var list = templateUtils.__get__('list');

list(templates);
expect(log.info.calls[0].args).toEqual(['\n']);
expect(log.info.calls[0].args).toEqual([EOL]);
expect(log.info.calls[1].args[0]).toMatch('a-template'); // Use match because of colors
expect(log.info.calls[1].args[1]).toEqual('...........');
expect(log.info.calls[1].args[2]).toEqual(templates[0].description);
Expand Down