| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,6 +18,7 @@ var Logging = IonicAppLib.logging; | |||
| 18 | 18 | var log = Logging.logger; | |
| 19 | 19 | var Q = require('q'); | |
| 20 | 20 | var helpUtil = require('./utils/help'); | |
| 21 | + var EOL = require('os').EOL; | ||
| 21 | 22 | ||
| 22 | 23 | Cli.ALL_TASKS = Tasks; | |
| 23 | 24 | Cli.IONIC_DASH = 'https://apps.ionic.io'; | |
@@ -268,7 +269,7 @@ Cli.loadGulpfile = function loadGulpfile() { | |||
| 268 | 269 | var names = ['gulpfile.js', 'Gulpfile.js']; | |
| 269 | 270 | for (var i = 0, ii = names.length; i < ii; i += 1) { | |
| 270 | 271 | try { | |
| 271 | - require(path.resolve(process.cwd() + '/' + names[i])); | ||
| 272 | + require(path.resolve(process.cwd(), names[i])); | ||
| 272 | 273 | log.verbose('Gulpfile found'); | |
| 273 | 274 | return true; | |
| 274 | 275 | } catch (e) { | |
@@ -331,7 +332,7 @@ Cli.runNpmHook = function runNpmHook(hook) { | |||
| 331 | 332 | }); | |
| 332 | 333 | spawned.stdout.pipe(process.stdout); | |
| 333 | 334 | spawned.stdout.on('data', function(data) { | |
| 334 | - var dataLines = data.toString().split('\n'); | ||
| 335 | + var dataLines = data.toString().split(EOL); | ||
| 335 | 336 | for (var i = 0; i < dataLines.length; i++) { | |
| 336 | 337 | if (dataLines[i].length) { | |
| 337 | 338 | if (dataLines[i].indexOf('watch ready') > -1) { | |
@@ -360,7 +361,7 @@ Cli.loadNpmScripts = function loadNpmScripts() { | |||
| 360 | 361 | var fileName = 'package.json'; | |
| 361 | 362 | ||
| 362 | 363 | try { | |
| 363 | - var packageFile = require(path.resolve(process.cwd() + '/' + fileName)); | ||
| 364 | + var packageFile = require(path.resolve(process.cwd(), fileName)); | ||
| 364 | 365 | log.verbose('Package.json found scripts:', packageFile.scripts); | |
| 365 | 366 | return packageFile.scripts; | |
| 366 | 367 | } catch (e) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | var IonicAppLib = require('ionic-app-lib'); | |
| 4 | 4 | var log = IonicAppLib.logging.logger; | |
| 5 | + var EOL = require('os').EOL; | ||
| 5 | 6 | require('colors'); | |
| 6 | 7 | ||
| 7 | 8 | /** | |
@@ -173,7 +174,7 @@ function printTaskDetails(d) { | |||
| 173 | 174 | } | |
| 174 | 175 | w((indent + ' ' + arg + ' ').bold); | |
| 175 | 176 | ||
| 176 | - var argDescs = d.args[arg].split('\n'); | ||
| 177 | + var argDescs = d.args[arg].split(EOL); | ||
| 177 | 178 | var argIndent = indent + ' '; | |
| 178 | 179 | ||
| 179 | 180 | for (x = 0; x < arg.length + 1; x += 1) { | |
@@ -218,9 +219,9 @@ function printTaskDetails(d) { | |||
| 218 | 219 | var optDescs; | |
| 219 | 220 | ||
| 220 | 221 | if (typeof taskOpt == 'string') { | |
| 221 | - optDescs = taskOpt.split('\n'); | ||
| 222 | + optDescs = taskOpt.split(EOL); | ||
| 222 | 223 | } else { | |
| 223 | - optDescs = taskOpt.title.split('\n'); | ||
| 224 | + optDescs = taskOpt.title.split(EOL); | ||
| 224 | 225 | } | |
| 225 | 226 | for (x = 0; x < optDescs.length; x += 1) { | |
| 226 | 227 | if (x === 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ var rewire = require('rewire'); | |||
| 5 | 5 | var templateUtils = rewire('../../lib/utils/templates'); | |
| 6 | 6 | var IonicAppLib = require('ionic-app-lib'); | |
| 7 | 7 | var log = IonicAppLib.logging.logger; | |
| 8 | + var EOL = require('os').EOL; | ||
| 8 | 9 | ||
| 9 | 10 | describe('listTemplates method', function() { | |
| 10 | 11 | it('should should call fetchStarterTemplates pull out templates/sort and send to list', function(done) { | |
@@ -148,7 +149,7 @@ describe('list function', function() { | |||
| 148 | 149 | var list = templateUtils.__get__('list'); | |
| 149 | 150 | ||
| 150 | 151 | list(templates); | |
| 151 | - expect(log.info.calls[0].args).toEqual(['\n']); | ||
| 152 | + expect(log.info.calls[0].args).toEqual([EOL]); | ||
| 152 | 153 | expect(log.info.calls[1].args[0]).toMatch('a-template'); // Use match because of colors | |
| 153 | 154 | expect(log.info.calls[1].args[1]).toEqual('...........'); | |
| 154 | 155 | expect(log.info.calls[1].args[2]).toEqual(templates[0].description); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments