File: pwd.js

package info (click to toggle)
guitarix 0.46.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 178,800 kB
  • sloc: cpp: 566,226; ansic: 132,774; javascript: 54,287; python: 42,419; fortran: 26,149; sh: 2,762; makefile: 761; pascal: 591; xml: 194; perl: 183; php: 127; lisp: 32
file content (28 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var shell = require('..');

var assert = require('assert'),
    path = require('path');

shell.silent(true);

function numLines(str) {
  return typeof str === 'string' ? str.match(/\n/g).length : 0;
}

shell.rm('-rf', 'tmp');
shell.mkdir('tmp')

//
// Valids
//

var _pwd = shell.pwd();
assert.equal(shell.error(), null);
assert.equal(_pwd, path.resolve('.'));

shell.cd('tmp');
var _pwd = shell.pwd();
assert.equal(shell.error(), null);
assert.equal(path.basename(_pwd), 'tmp');

shell.exit(123);