Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / test / test-50-observe-snapshot-root / test-x-index.js
684 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.statSync(root + 'snapshot').isDirectory()) { |
9 | var root2 = root.slice(0, 2) + '/'; |
10 | if (fs.statSync(root2 + 'snapshot').isDirectory()) { |
11 | try { |
12 | fs.statSync('/snapshot'); |
13 | } catch (error) { |
14 | if (error.code === 'ENOENT') { |
15 | console.log('ok'); |
16 | } |
17 | } |
18 | } |
19 | } |
20 | } else { |
21 | if (fs.statSync('/snapshot').isDirectory()) { |
22 | try { |
23 | fs.statSync('K:\\snapshot'); |
24 | } catch (error) { |
25 | if (error.code === 'ENOENT') { |
26 | console.log('ok'); |
27 | } |
28 | } |
29 | } |
30 | } |
31 |
Built with git-ssb-web