Files: 1eb144e388da5f1a3466703f56ac4ab591d700fc / test / test-50-observe-snapshot-root-2 / test-x-index.js
904 bytesRaw
1 | ; |
2 | |
3 | var fs = require('fs'); |
4 | var path = require('path'); |
5 | |
6 | if (process.platform === 'win32') { |
7 | var root = path.parse(process.argv[1]).root; // D:\\ |
8 | if (fs.readdirSync(root).indexOf('snapshot') >= 0) { |
9 | var root2 = root.slice(0, 2) + '/'; |
10 | if (fs.readdirSync(root2).indexOf('snapshot') >= 0) { |
11 | fs.readdir(root, function (error, entries) { |
12 | if (error) throw error; |
13 | if (entries.indexOf('snapshot')) { |
14 | fs.readdir(root2, function (error2, entries2) { |
15 | if (error2) throw error2; |
16 | if (entries2.indexOf('snapshot')) { |
17 | console.log('ok'); |
18 | } |
19 | }); |
20 | } |
21 | }); |
22 | } |
23 | } |
24 | } else { |
25 | if (fs.readdirSync('/').indexOf('snapshot') >= 0) { |
26 | fs.readdir('/', function (error, entries) { |
27 | if (error) throw error; |
28 | if (entries.indexOf('snapshot')) { |
29 | console.log('ok'); |
30 | } |
31 | }); |
32 | } |
33 | } |
34 |
Built with git-ssb-web