From 27847f379f4649684ea4a1fbefc24a042d657b6b Mon Sep 17 00:00:00 2001 From: Pedro Santos Date: Tue, 3 Dec 2019 15:26:42 +0000 Subject: [PATCH 1/3] feat: add --hidden flag to cli add command --- src/cli/commands/add.js | 8 +++++++- test/cli/files.js | 7 +++++++ test/fixtures/test-data/recursive-get-dir/.hidden.txt | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/test-data/recursive-get-dir/.hidden.txt diff --git a/src/cli/commands/add.js b/src/cli/commands/add.js index 3bfe6f9866..2e1c8cd413 100644 --- a/src/cli/commands/add.js +++ b/src/cli/commands/add.js @@ -106,6 +106,12 @@ module.exports = { type: 'boolean', default: true, describe: 'Preload this object when adding' + }, + hidden: { + alias: 'H', + type: 'boolean', + default: false, + describe: 'Include files that are hidden. Only takes effect on recursive add.' } }, @@ -153,7 +159,7 @@ module.exports = { } const source = argv.file - ? globSource(argv.file, { recursive: argv.recursive }) + ? globSource(argv.file, { recursive: argv.recursive, hidden: argv.hidden }) : process.stdin // Pipe directly to ipfs.add let finalHash diff --git a/test/cli/files.js b/test/cli/files.js index 4858cc0cb0..f0e732b986 100644 --- a/test/cli/files.js +++ b/test/cli/files.js @@ -165,6 +165,13 @@ describe('files', () => runOnAndOff((thing) => { expect(out).to.equal(recursiveGetDirResults.join('\n') + '\n') }) + it('add recursively including hidden files', async function () { + this.timeout(60 * 1000) + + const out = await ipfs('add -r -H test/fixtures/test-data/recursive-get-dir') + expect(out).to.include('added QmdBd5zgdJQHsyaaAm9Vnth7NWwj23gj3Ew17r6bTvVkch recursive-get-dir/.hidden.txt') + }) + it('add directory with trailing slash test', async function () { this.timeout(30 * 1000) diff --git a/test/fixtures/test-data/recursive-get-dir/.hidden.txt b/test/fixtures/test-data/recursive-get-dir/.hidden.txt new file mode 100644 index 0000000000..9cf573565b --- /dev/null +++ b/test/fixtures/test-data/recursive-get-dir/.hidden.txt @@ -0,0 +1 @@ +This file is hidden! From 449bb01e741ae278490307f9e8db545635556841 Mon Sep 17 00:00:00 2001 From: Pedro Santos Date: Wed, 4 Dec 2019 11:44:03 +0000 Subject: [PATCH 2/3] fix: update folder hash on get-recursively cli test --- test/cli/files.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cli/files.js b/test/cli/files.js index f0e732b986..b1376b7d59 100644 --- a/test/cli/files.js +++ b/test/cli/files.js @@ -417,12 +417,12 @@ describe('files', () => runOnAndOff((thing) => { it('get recursively', async function () { this.timeout(20 * 1000) - const outDir = path.join(process.cwd(), 'Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z') + const outDir = path.join(process.cwd(), 'QmTCaAvZ5dquoa2jrgTRa3gn9n4Ymrz8mEdePP8jiaTvf9') rimraf(outDir) - const out = await ipfs('get Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z') + const out = await ipfs('get QmTCaAvZ5dquoa2jrgTRa3gn9n4Ymrz8mEdePP8jiaTvf9') expect(out).to.eql( - 'Saving file(s) Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z\n' + 'Saving file(s) QmTCaAvZ5dquoa2jrgTRa3gn9n4Ymrz8mEdePP8jiaTvf9\n' ) const expectedDir = path.join(process.cwd(), 'test', 'fixtures', 'test-data', 'recursive-get-dir') From 5868dc26700c6e0475217960e3efb0c489c43c2e Mon Sep 17 00:00:00 2001 From: Pedro Santos Date: Fri, 6 Dec 2019 16:49:39 +0000 Subject: [PATCH 3/3] fix: increase bundle max size --- .aegir.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aegir.js b/.aegir.js index 424edce795..d0bc9dd9a8 100644 --- a/.aegir.js +++ b/.aegir.js @@ -11,7 +11,7 @@ const preloadNode = MockPreloadNode.createNode() const echoServer = EchoServer.createServer() module.exports = { - bundlesize: { maxSize: '650kB' }, + bundlesize: { maxSize: '651kB' }, webpack: { resolve: { mainFields: ['browser', 'main'],