]> git.wincent.com - wincent.git/commitdiff
refactor(fig): move wrappers for POSIX utilities into posix/
authorGreg Hurrell <greg@hurrell.net>
Tue, 21 Apr 2020 21:28:15 +0000 (23:28 +0200)
committerGreg Hurrell <greg@hurrell.net>
Tue, 21 Apr 2020 21:28:15 +0000 (23:28 +0200)
17 files changed:
src/Attributes.ts
src/Fig/operations/file.ts
src/fs/tempdir.ts
src/fs/tempfile.ts
src/fs/tempname.ts [moved from src/tempname.ts with 100% similarity]
src/posix/__tests__/chmod-test.ts [moved from src/fs/__tests__/chmod-test.ts with 89% similarity]
src/posix/__tests__/ln-test.ts [moved from src/fs/__tests__/ln-test.ts with 95% similarity]
src/posix/__tests__/rm-test.ts [moved from src/fs/__tests__/rm-test.ts with 94% similarity]
src/posix/__tests__/touch-test.ts [moved from src/fs/__tests__/touch-test.ts with 87% similarity]
src/posix/chmod.ts [moved from src/fs/chmod.ts with 100% similarity]
src/posix/chown.ts [moved from src/fs/chown.ts with 100% similarity]
src/posix/cp.ts [moved from src/fs/cp.ts with 100% similarity]
src/posix/id.ts [moved from src/id.ts with 92% similarity]
src/posix/ln.ts [moved from src/fs/ln.ts with 100% similarity]
src/posix/mkdir.ts [moved from src/fs/mkdir.ts with 100% similarity]
src/posix/rm.ts [moved from src/fs/rm.ts with 100% similarity]
src/posix/touch.ts [moved from src/fs/touch.ts with 100% similarity]

index e90b2e524f544532d3cf7106e947373956e8c04c..25f93c7d0dfa79447ad934a1636b4cf2e21327b8 100644 (file)
@@ -1,6 +1,6 @@
 import * as os from 'os';
 
-import id from './id.js';
+import id from './posix/id.js';
 import stringify from './stringify.js';
 
 /**
index 114c185fc0883901f5e69117f0527b4849bfe81a..9af7c2d055bb91ded5c3afd729b82808212b0ef1 100644 (file)
@@ -1,12 +1,12 @@
 import ErrorWithMetadata from '../../ErrorWithMetadata.js';
 import {promises as fs} from '../../fs.js';
-import chmod from '../../fs/chmod.js';
-import chown from '../../fs/chown.js';
-import cp from '../../fs/cp.js';
-import ln from '../../fs/ln.js';
-import mkdir from '../../fs/mkdir.js';
 import tempfile from '../../fs/tempfile.js';
-import touch from '../../fs/touch.js';
+import chmod from '../../posix/chmod.js';
+import chown from '../../posix/chown.js';
+import cp from '../../posix/cp.js';
+import ln from '../../posix/ln.js';
+import mkdir from '../../posix/mkdir.js';
+import touch from '../../posix/touch.js';
 import {default as toPath} from '../../path.js';
 import Context from '../Context.js';
 import assert from '../../assert.js';
index 22db600628708574cc01f211bdee85e676d13ccd..9085466e6809032bc85e835ab4e98a0e8cc6e704 100644 (file)
@@ -1,5 +1,5 @@
-import mkdir from './mkdir.js';
-import tempname from '../tempname.js';
+import mkdir from '../posix/mkdir.js';
+import tempname from './tempname.js';
 
 export default async function tempdir(prefix: string): Promise<string> {
     const path = tempname(prefix);
index 0182e37564e524d413e4d74bd43e748ee996c481..08086103d2d9168c600cd75d2d7498689c877a9f 100644 (file)
@@ -1,6 +1,6 @@
 import {log} from '../console.js';
 import {promises as fs} from '../fs.js';
-import tempname from '../tempname.js';
+import tempname from './tempname.js';
 
 /**
  * Writes the `contents` to a temporary file and returns the path to that file.
similarity index 100%
rename from src/tempname.ts
rename to src/fs/tempname.ts
similarity index 89%
rename from src/fs/__tests__/chmod-test.ts
rename to src/posix/__tests__/chmod-test.ts
index 6034de187b7491dada9a342b301f6afcffd97593..dcb228144428670687acf80c7e7142a42010d72a 100644 (file)
@@ -1,9 +1,9 @@
 import assert from '../../assert.js';
+import stat from '../../fs/stat.js';
+import tempdir from '../../fs/tempdir.js';
+import tempfile from '../../fs/tempfile.js';
 import {expect, test} from '../../test/harness.js';
 import chmod from '../chmod.js';
-import stat from '../stat.js';
-import tempdir from '../tempdir.js';
-import tempfile from '../tempfile.js';
 
 test('chmod() changes the mode of a file', async () => {
     const path = await tempfile('chmod-test');
similarity index 95%
rename from src/fs/__tests__/ln-test.ts
rename to src/posix/__tests__/ln-test.ts
index 473d83037c6738406c235731be8ccd65593b7194..9bec50b29fe32f75dcdcf6afa92e62e3ab72fd81 100644 (file)
@@ -1,10 +1,10 @@
 import {join} from 'path';
 
 import assert from '../../assert.js';
+import stat from '../../fs/stat.js';
+import tempdir from '../../fs/tempdir.js';
 import {expect, test} from '../../test/harness.js';
 import ln from '../ln.js';
-import stat from '../stat.js';
-import tempdir from '../tempdir.js';
 import touch from '../touch.js';
 
 test('ln() links a file', async () => {
similarity index 94%
rename from src/fs/__tests__/rm-test.ts
rename to src/posix/__tests__/rm-test.ts
index 268d40ca27596a5ded04afa27b4dd46ac9ca9476..69e7adde6393fb7f46e80f77d7824aeac950f8fe 100644 (file)
@@ -3,9 +3,9 @@ import assert from '../../assert.js';
 import {expect, test} from '../../test/harness.js';
 import chmod from '../chmod.js';
 import rm from '../rm.js';
-import stat from '../stat.js';
-import tempdir from '../tempdir.js';
-import tempfile from '../tempfile.js';
+import stat from '../../fs/stat.js';
+import tempdir from '../../fs/tempdir.js';
+import tempfile from '../../fs/tempfile.js';
 import touch from '../touch.js';
 
 test('rm() removes a file', async () => {
similarity index 87%
rename from src/fs/__tests__/touch-test.ts
rename to src/posix/__tests__/touch-test.ts
index 25005d0d430a55395451140db00f4e34ca9cad01..019bc69f72584fdb1d3a30b9e54bf88019d7d56e 100644 (file)
@@ -1,8 +1,9 @@
 import {join} from 'path';
+
 import assert from '../../assert.js';
+import stat from '../../fs/stat.js';
+import tempdir from '../../fs/tempdir.js';
 import {expect, test} from '../../test/harness.js';
-import stat from '../stat.js';
-import tempdir from '../tempdir.js';
 import touch from '../touch.js';
 
 test('touch() creates a file', async () => {
similarity index 100%
rename from src/fs/chmod.ts
rename to src/posix/chmod.ts
similarity index 100%
rename from src/fs/chown.ts
rename to src/posix/chown.ts
similarity index 100%
rename from src/fs/cp.ts
rename to src/posix/cp.ts
similarity index 92%
rename from src/id.ts
rename to src/posix/id.ts
index 31fb836b8304256dec544a858bac19ee074e3967..118e5e258f034886df71054e5b554b87f31eba04 100644 (file)
--- a/src/id.ts
@@ -1,5 +1,5 @@
-import ErrorWithMetadata from './ErrorWithMetadata.js';
-import {spawnSync} from './child_process.js';
+import ErrorWithMetadata from '../ErrorWithMetadata.js';
+import {spawnSync} from '../child_process.js';
 
 /**
  * For the benefit of the `Attributes` class, we want a synchronous way
similarity index 100%
rename from src/fs/ln.ts
rename to src/posix/ln.ts
similarity index 100%
rename from src/fs/mkdir.ts
rename to src/posix/mkdir.ts
similarity index 100%
rename from src/fs/rm.ts
rename to src/posix/rm.ts
similarity index 100%
rename from src/fs/touch.ts
rename to src/posix/touch.ts