@emulsify/cli 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -13
- package/dist/index.js +14 -6
- package/dist/node_modules/.package-lock.json +37 -24
- package/dist/node_modules/@types/node/README.md +5 -6
- package/dist/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/dist/node_modules/@types/node/assert.d.ts +955 -45
- package/dist/node_modules/@types/node/async_hooks.d.ts +391 -87
- package/dist/node_modules/@types/node/buffer.d.ts +2210 -17
- package/dist/node_modules/@types/node/child_process.d.ts +1051 -189
- package/dist/node_modules/@types/node/cluster.d.ts +421 -143
- package/dist/node_modules/@types/node/console.d.ts +359 -49
- package/dist/node_modules/@types/node/constants.d.ts +3 -3
- package/dist/node_modules/@types/node/crypto.d.ts +3528 -291
- package/dist/node_modules/@types/node/dgram.d.ts +446 -30
- package/dist/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/dist/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/dist/node_modules/@types/node/dns.d.ts +588 -240
- package/dist/node_modules/@types/node/dom-events.d.ts +124 -0
- package/dist/node_modules/@types/node/domain.d.ts +159 -16
- package/dist/node_modules/@types/node/events.d.ts +890 -41
- package/dist/node_modules/@types/node/fs/promises.d.ts +980 -369
- package/dist/node_modules/@types/node/fs.d.ts +2599 -869
- package/dist/node_modules/@types/node/globals.d.ts +374 -727
- package/dist/node_modules/@types/node/globals.global.d.ts +1 -1
- package/dist/node_modules/@types/node/http.d.ts +1459 -132
- package/dist/node_modules/@types/node/http2.d.ts +1333 -123
- package/dist/node_modules/@types/node/https.d.ts +289 -13
- package/dist/node_modules/@types/node/index.d.ts +37 -46
- package/dist/node_modules/@types/node/inspector.d.ts +367 -671
- package/dist/node_modules/@types/node/module.d.ts +273 -14
- package/dist/node_modules/@types/node/net.d.ts +741 -66
- package/dist/node_modules/@types/node/os.d.ts +275 -23
- package/dist/node_modules/@types/node/package.json +95 -110
- package/dist/node_modules/@types/node/path.d.ts +27 -4
- package/dist/node_modules/@types/node/perf_hooks.d.ts +756 -125
- package/dist/node_modules/@types/node/process.d.ts +1429 -127
- package/dist/node_modules/@types/node/punycode.d.ts +65 -26
- package/dist/node_modules/@types/node/querystring.d.ts +121 -9
- package/dist/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/dist/node_modules/@types/node/readline.d.ts +405 -49
- package/dist/node_modules/@types/node/repl.d.ts +99 -73
- package/dist/node_modules/@types/node/sea.d.ts +153 -0
- package/dist/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/dist/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/dist/node_modules/@types/node/stream/web.d.ts +367 -0
- package/dist/node_modules/@types/node/stream.d.ts +1462 -273
- package/dist/node_modules/@types/node/string_decoder.d.ts +59 -2
- package/dist/node_modules/@types/node/test.d.ts +1719 -0
- package/dist/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/dist/node_modules/@types/node/timers.d.ts +233 -12
- package/dist/node_modules/@types/node/tls.d.ts +540 -189
- package/dist/node_modules/@types/node/trace_events.d.ts +143 -10
- package/dist/node_modules/@types/node/tty.d.ts +156 -17
- package/dist/node_modules/@types/node/url.d.ts +812 -47
- package/dist/node_modules/@types/node/util.d.ts +2159 -145
- package/dist/node_modules/@types/node/v8.d.ts +693 -74
- package/dist/node_modules/@types/node/vm.d.ts +813 -44
- package/dist/node_modules/@types/node/wasi.d.ts +121 -28
- package/dist/node_modules/@types/node/worker_threads.d.ts +514 -61
- package/dist/node_modules/@types/node/zlib.d.ts +220 -54
- package/dist/node_modules/ajv-formats/node_modules/ajv/README.md +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.d.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.d.ts +10 -10
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +5 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/code.ts +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/index.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/resolve.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/uri.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/index.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/json-schema.ts +10 -10
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/index.ts +4 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/package.json +5 -5
- package/dist/node_modules/commander/Readme.md +10 -8
- package/dist/node_modules/commander/esm.mjs +1 -1
- package/dist/node_modules/commander/lib/argument.js +9 -5
- package/dist/node_modules/commander/lib/command.js +406 -196
- package/dist/node_modules/commander/lib/error.js +0 -4
- package/dist/node_modules/commander/lib/help.js +101 -38
- package/dist/node_modules/commander/lib/option.js +11 -8
- package/dist/node_modules/commander/lib/suggestSimilar.js +5 -4
- package/dist/node_modules/commander/package.json +23 -19
- package/dist/node_modules/commander/typings/index.d.ts +110 -40
- package/dist/node_modules/debug/package.json +4 -3
- package/dist/node_modules/debug/src/browser.js +3 -1
- package/dist/node_modules/debug/src/node.js +2 -2
- package/dist/node_modules/fast-uri/.gitattributes +2 -0
- package/dist/node_modules/fast-uri/.github/.stale.yml +21 -0
- package/dist/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/dist/node_modules/fast-uri/.github/tests_checker.yml +8 -0
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +23 -0
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +20 -0
- package/dist/node_modules/fast-uri/.taprc +3 -0
- package/dist/node_modules/fast-uri/LICENSE +30 -0
- package/dist/node_modules/fast-uri/README.md +125 -0
- package/dist/node_modules/fast-uri/benchmark.js +105 -0
- package/dist/node_modules/fast-uri/index.js +309 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +188 -0
- package/dist/node_modules/fast-uri/lib/scopedChars.js +30 -0
- package/dist/node_modules/fast-uri/lib/utils.js +242 -0
- package/dist/node_modules/fast-uri/package.json +39 -0
- package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
- package/dist/node_modules/fast-uri/test/ajv.test.js +39 -0
- package/dist/node_modules/fast-uri/test/compatibility.test.js +130 -0
- package/dist/node_modules/fast-uri/test/equal.test.js +104 -0
- package/dist/node_modules/fast-uri/test/parse.test.js +319 -0
- package/dist/node_modules/fast-uri/test/resolve.test.js +76 -0
- package/dist/node_modules/fast-uri/test/serialize.test.js +144 -0
- package/dist/node_modules/fast-uri/test/uri-js.test.js +940 -0
- package/dist/node_modules/fast-uri/test/util.test.js +24 -0
- package/dist/node_modules/fast-uri/types/index.d.ts +53 -0
- package/dist/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/dist/node_modules/fs-extra/README.md +32 -2
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +3 -11
- package/dist/node_modules/fs-extra/lib/copy/copy.js +120 -178
- package/dist/node_modules/fs-extra/lib/copy/index.js +1 -1
- package/dist/node_modules/fs-extra/lib/ensure/file.js +31 -34
- package/dist/node_modules/fs-extra/lib/ensure/link.js +27 -27
- package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +57 -55
- package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +16 -13
- package/dist/node_modules/fs-extra/lib/ensure/symlink.js +29 -44
- package/dist/node_modules/fs-extra/lib/esm.mjs +68 -0
- package/dist/node_modules/fs-extra/lib/fs/index.js +29 -17
- package/dist/node_modules/fs-extra/lib/move/index.js +1 -1
- package/dist/node_modules/fs-extra/lib/move/move-sync.js +2 -1
- package/dist/node_modules/fs-extra/lib/move/move.js +38 -54
- package/dist/node_modules/fs-extra/lib/output-file/index.js +10 -19
- package/dist/node_modules/fs-extra/lib/remove/index.js +2 -7
- package/dist/node_modules/fs-extra/lib/util/stat.js +46 -42
- package/dist/node_modules/fs-extra/lib/util/utimes.js +21 -11
- package/dist/node_modules/fs-extra/package.json +11 -7
- package/dist/node_modules/simple-git/dist/cjs/index.js +4958 -0
- package/dist/node_modules/simple-git/dist/cjs/index.js.map +7 -0
- package/dist/node_modules/simple-git/dist/esm/index.js +4813 -0
- package/dist/node_modules/simple-git/dist/esm/index.js.map +7 -0
- package/dist/node_modules/simple-git/dist/esm/package.json +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/api.d.ts +3 -13
- package/dist/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/args/pathspec.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-error.d.ts +3 -2
- package/dist/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-branch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-list-log-summary.d.ts +2 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-pull.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/completion-detection.plugin.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/index.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/progress-monitor-plugin.d.ts +1 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/simple-git-plugin.d.ts +10 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/FileStatusSummary.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/StatusSummary.d.ts +2 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/git-executor-chain.d.ts +1 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/git-executor.d.ts +3 -4
- package/dist/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/clone.d.ts +3 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/config.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/fetch.d.ts +2 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/log.d.ts +3 -3
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/remote.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/task.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/types/index.d.ts +64 -5
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/exit-codes.d.ts +1 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/line-parser.d.ts +1 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/task-parser.d.ts +2 -2
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/util.d.ts +3 -1
- package/dist/node_modules/simple-git/{typings → dist/typings}/errors.d.ts +0 -1
- package/dist/node_modules/simple-git/{typings → dist/typings}/index.d.ts +2 -1
- package/dist/node_modules/simple-git/{typings → dist/typings}/response.d.ts +68 -25
- package/dist/node_modules/simple-git/{typings → dist/typings}/simple-git.d.ts +493 -110
- package/dist/node_modules/simple-git/dist/typings/types.d.ts +23 -0
- package/dist/node_modules/simple-git/package.json +32 -35
- package/dist/node_modules/simple-git/promise.js +14 -4
- package/dist/node_modules/simple-git/readme.md +372 -389
- package/dist/node_modules/undici-types/README.md +6 -0
- package/dist/node_modules/undici-types/agent.d.ts +31 -0
- package/dist/node_modules/undici-types/api.d.ts +43 -0
- package/dist/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/dist/node_modules/undici-types/cache.d.ts +36 -0
- package/dist/node_modules/undici-types/client.d.ts +97 -0
- package/dist/node_modules/undici-types/connector.d.ts +34 -0
- package/dist/node_modules/undici-types/content-type.d.ts +21 -0
- package/dist/node_modules/undici-types/cookies.d.ts +28 -0
- package/dist/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/dist/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/dist/node_modules/undici-types/errors.d.ts +128 -0
- package/dist/node_modules/undici-types/fetch.d.ts +209 -0
- package/dist/node_modules/undici-types/file.d.ts +39 -0
- package/dist/node_modules/undici-types/filereader.d.ts +54 -0
- package/dist/node_modules/undici-types/formdata.d.ts +108 -0
- package/dist/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/dist/node_modules/undici-types/global-origin.d.ts +7 -0
- package/dist/node_modules/undici-types/handlers.d.ts +9 -0
- package/dist/node_modules/undici-types/header.d.ts +4 -0
- package/dist/node_modules/undici-types/index.d.ts +63 -0
- package/dist/node_modules/undici-types/interceptors.d.ts +5 -0
- package/dist/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/dist/node_modules/undici-types/mock-client.d.ts +25 -0
- package/dist/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/dist/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/dist/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/dist/node_modules/undici-types/package.json +55 -0
- package/dist/node_modules/undici-types/patch.d.ts +71 -0
- package/dist/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/dist/node_modules/undici-types/pool.d.ts +28 -0
- package/dist/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/dist/node_modules/undici-types/readable.d.ts +61 -0
- package/dist/node_modules/undici-types/webidl.d.ts +220 -0
- package/dist/node_modules/undici-types/websocket.d.ts +131 -0
- package/dist/package-lock.json +10146 -0
- package/dist/package.json +23 -23
- package/dist/schemas/variant.json +5 -21
- package/package.json +24 -24
- package/dist/node_modules/@types/node/ts4.8/assert.d.ts +0 -130
- package/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -237
- package/dist/node_modules/@types/node/ts4.8/buffer.d.ts +0 -89
- package/dist/node_modules/@types/node/ts4.8/child_process.d.ts +0 -682
- package/dist/node_modules/@types/node/ts4.8/cluster.d.ts +0 -300
- package/dist/node_modules/@types/node/ts4.8/console.d.ts +0 -142
- package/dist/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/dist/node_modules/@types/node/ts4.8/crypto.d.ts +0 -1287
- package/dist/node_modules/@types/node/ts4.8/dgram.d.ts +0 -180
- package/dist/node_modules/@types/node/ts4.8/dns.d.ts +0 -516
- package/dist/node_modules/@types/node/ts4.8/domain.d.ts +0 -27
- package/dist/node_modules/@types/node/ts4.8/events.d.ts +0 -82
- package/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -634
- package/dist/node_modules/@types/node/ts4.8/fs.d.ts +0 -2587
- package/dist/node_modules/@types/node/ts4.8/globals.d.ts +0 -763
- package/dist/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/dist/node_modules/@types/node/ts4.8/http.d.ts +0 -580
- package/dist/node_modules/@types/node/ts4.8/http2.d.ts +0 -1208
- package/dist/node_modules/@types/node/ts4.8/https.d.ts +0 -274
- package/dist/node_modules/@types/node/ts4.8/index.d.ts +0 -53
- package/dist/node_modules/@types/node/ts4.8/inspector.d.ts +0 -3050
- package/dist/node_modules/@types/node/ts4.8/module.d.ts +0 -56
- package/dist/node_modules/@types/node/ts4.8/net.d.ts +0 -324
- package/dist/node_modules/@types/node/ts4.8/os.d.ts +0 -243
- package/dist/node_modules/@types/node/ts4.8/path.d.ts +0 -168
- package/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -274
- package/dist/node_modules/@types/node/ts4.8/process.d.ts +0 -452
- package/dist/node_modules/@types/node/ts4.8/punycode.d.ts +0 -78
- package/dist/node_modules/@types/node/ts4.8/querystring.d.ts +0 -41
- package/dist/node_modules/@types/node/ts4.8/readline.d.ts +0 -184
- package/dist/node_modules/@types/node/ts4.8/repl.d.ts +0 -404
- package/dist/node_modules/@types/node/ts4.8/stream.d.ts +0 -518
- package/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -10
- package/dist/node_modules/@types/node/ts4.8/timers.d.ts +0 -19
- package/dist/node_modules/@types/node/ts4.8/tls.d.ts +0 -866
- package/dist/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -64
- package/dist/node_modules/@types/node/ts4.8/tty.d.ts +0 -69
- package/dist/node_modules/@types/node/ts4.8/url.d.ts +0 -187
- package/dist/node_modules/@types/node/ts4.8/util.d.ts +0 -278
- package/dist/node_modules/@types/node/ts4.8/v8.d.ts +0 -189
- package/dist/node_modules/@types/node/ts4.8/vm.d.ts +0 -155
- package/dist/node_modules/@types/node/ts4.8/wasi.d.ts +0 -88
- package/dist/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -241
- package/dist/node_modules/@types/node/ts4.8/zlib.d.ts +0 -364
- package/dist/node_modules/fs-extra/lib/remove/rimraf.js +0 -302
- package/dist/node_modules/simple-git/CHANGELOG.md +0 -529
- package/dist/node_modules/simple-git/LICENSE +0 -20
- package/dist/node_modules/simple-git/promise.d.ts +0 -46
- package/dist/node_modules/simple-git/src/git.js +0 -700
- package/dist/node_modules/simple-git/src/index.js +0 -7
- package/dist/node_modules/simple-git/src/lib/api.js +0 -26
- package/dist/node_modules/simple-git/src/lib/api.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-construct-error.js +0 -21
- package/dist/node_modules/simple-git/src/lib/errors/git-construct-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-error.js +0 -37
- package/dist/node_modules/simple-git/src/lib/errors/git-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.d.ts +0 -6
- package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.js +0 -14
- package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-response-error.js +0 -36
- package/dist/node_modules/simple-git/src/lib/errors/git-response-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/task-configuration-error.js +0 -19
- package/dist/node_modules/simple-git/src/lib/errors/task-configuration-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/git-factory.d.ts +0 -25
- package/dist/node_modules/simple-git/src/lib/git-factory.js +0 -45
- package/dist/node_modules/simple-git/src/lib/git-factory.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/git-logger.js +0 -101
- package/dist/node_modules/simple-git/src/lib/git-logger.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch-delete.js +0 -29
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch-delete.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch.js +0 -18
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-commit.js +0 -53
- package/dist/node_modules/simple-git/src/lib/parsers/parse-commit.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.d.ts +0 -2
- package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.js +0 -74
- package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-fetch.js +0 -32
- package/dist/node_modules/simple-git/src/lib/parsers/parse-fetch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js +0 -35
- package/dist/node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-merge.js +0 -39
- package/dist/node_modules/simple-git/src/lib/parsers/parse-merge.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-move.js +0 -14
- package/dist/node_modules/simple-git/src/lib/parsers/parse-move.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-pull.js +0 -42
- package/dist/node_modules/simple-git/src/lib/parsers/parse-pull.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-push.js +0 -58
- package/dist/node_modules/simple-git/src/lib/parsers/parse-push.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-messages.js +0 -33
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-messages.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-objects.js +0 -41
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-objects.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js +0 -15
- package/dist/node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js +0 -80
- package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js +0 -39
- package/dist/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/index.js +0 -21
- package/dist/node_modules/simple-git/src/lib/plugins/index.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.d.ts +0 -6
- package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.js +0 -28
- package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js +0 -45
- package/dist/node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.js +0 -3
- package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js +0 -15
- package/dist/node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.js +0 -37
- package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js +0 -31
- package/dist/node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.d.ts +0 -10
- package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.js +0 -26
- package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/CheckIgnore.js +0 -13
- package/dist/node_modules/simple-git/src/lib/responses/CheckIgnore.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/CleanSummary.js +0 -28
- package/dist/node_modules/simple-git/src/lib/responses/CleanSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/ConfigList.js +0 -89
- package/dist/node_modules/simple-git/src/lib/responses/ConfigList.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/DiffSummary.js +0 -16
- package/dist/node_modules/simple-git/src/lib/responses/DiffSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/FileStatusSummary.js +0 -18
- package/dist/node_modules/simple-git/src/lib/responses/FileStatusSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/GetRemoteSummary.js +0 -30
- package/dist/node_modules/simple-git/src/lib/responses/GetRemoteSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/InitSummary.js +0 -36
- package/dist/node_modules/simple-git/src/lib/responses/InitSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/MergeSummary.js +0 -35
- package/dist/node_modules/simple-git/src/lib/responses/MergeSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/PullSummary.d.ts +0 -12
- package/dist/node_modules/simple-git/src/lib/responses/PullSummary.js +0 -22
- package/dist/node_modules/simple-git/src/lib/responses/PullSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js +0 -128
- package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/TagList.js +0 -56
- package/dist/node_modules/simple-git/src/lib/responses/TagList.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js +0 -173
- package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/git-executor.js +0 -21
- package/dist/node_modules/simple-git/src/lib/runners/git-executor.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/promise-wrapped.js +0 -133
- package/dist/node_modules/simple-git/src/lib/runners/promise-wrapped.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/scheduler.js +0 -48
- package/dist/node_modules/simple-git/src/lib/runners/scheduler.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/tasks-pending-queue.js +0 -64
- package/dist/node_modules/simple-git/src/lib/runners/tasks-pending-queue.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/simple-git-api.js +0 -80
- package/dist/node_modules/simple-git/src/lib/simple-git-api.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/task-callback.js +0 -39
- package/dist/node_modules/simple-git/src/lib/task-callback.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/apply-patch.js +0 -9
- package/dist/node_modules/simple-git/src/lib/tasks/apply-patch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/branch.js +0 -76
- package/dist/node_modules/simple-git/src/lib/tasks/branch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/change-working-directory.js +0 -15
- package/dist/node_modules/simple-git/src/lib/tasks/change-working-directory.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/check-ignore.js +0 -13
- package/dist/node_modules/simple-git/src/lib/tasks/check-ignore.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/check-is-repo.js +0 -61
- package/dist/node_modules/simple-git/src/lib/tasks/check-is-repo.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/clean.js +0 -85
- package/dist/node_modules/simple-git/src/lib/tasks/clean.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/clone.js +0 -22
- package/dist/node_modules/simple-git/src/lib/tasks/clone.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/commit.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/tasks/commit.js +0 -16
- package/dist/node_modules/simple-git/src/lib/tasks/commit.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/config.js +0 -73
- package/dist/node_modules/simple-git/src/lib/tasks/config.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/diff.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/tasks/diff.js +0 -15
- package/dist/node_modules/simple-git/src/lib/tasks/diff.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/fetch.js +0 -17
- package/dist/node_modules/simple-git/src/lib/tasks/fetch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/grep.js +0 -76
- package/dist/node_modules/simple-git/src/lib/tasks/grep.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/hash-object.js +0 -16
- package/dist/node_modules/simple-git/src/lib/tasks/hash-object.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/init.js +0 -23
- package/dist/node_modules/simple-git/src/lib/tasks/init.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/log.js +0 -109
- package/dist/node_modules/simple-git/src/lib/tasks/log.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/merge.js +0 -24
- package/dist/node_modules/simple-git/src/lib/tasks/merge.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/move.js +0 -14
- package/dist/node_modules/simple-git/src/lib/tasks/move.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/pull.js +0 -19
- package/dist/node_modules/simple-git/src/lib/tasks/pull.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/push.js +0 -29
- package/dist/node_modules/simple-git/src/lib/tasks/push.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/remote.js +0 -42
- package/dist/node_modules/simple-git/src/lib/tasks/remote.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/reset.js +0 -38
- package/dist/node_modules/simple-git/src/lib/tasks/reset.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/stash-list.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/tasks/stash-list.js +0 -16
- package/dist/node_modules/simple-git/src/lib/tasks/stash-list.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/status.js +0 -15
- package/dist/node_modules/simple-git/src/lib/tasks/status.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/sub-module.js +0 -25
- package/dist/node_modules/simple-git/src/lib/tasks/sub-module.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/tag.js +0 -45
- package/dist/node_modules/simple-git/src/lib/tasks/tag.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/task.js +0 -52
- package/dist/node_modules/simple-git/src/lib/tasks/task.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/types/handlers.js +0 -3
- package/dist/node_modules/simple-git/src/lib/types/handlers.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/types/index.js +0 -15
- package/dist/node_modules/simple-git/src/lib/types/index.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/types/tasks.js +0 -3
- package/dist/node_modules/simple-git/src/lib/types/tasks.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/argument-filters.js +0 -47
- package/dist/node_modules/simple-git/src/lib/utils/argument-filters.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/exit-codes.js +0 -14
- package/dist/node_modules/simple-git/src/lib/utils/exit-codes.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/git-output-streams.js +0 -14
- package/dist/node_modules/simple-git/src/lib/utils/git-output-streams.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/index.js +0 -21
- package/dist/node_modules/simple-git/src/lib/utils/index.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/line-parser.js +0 -52
- package/dist/node_modules/simple-git/src/lib/utils/line-parser.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/simple-git-options.js +0 -16
- package/dist/node_modules/simple-git/src/lib/utils/simple-git-options.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/task-options.js +0 -58
- package/dist/node_modules/simple-git/src/lib/utils/task-options.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/task-parser.js +0 -24
- package/dist/node_modules/simple-git/src/lib/utils/task-parser.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/util.js +0 -146
- package/dist/node_modules/simple-git/src/lib/utils/util.js.map +0 -1
- package/dist/node_modules/simple-git/typings/types.d.ts +0 -14
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-construct-error.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-response-error.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/task-configuration-error.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/git-logger.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-branch-delete.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-commit.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-fetch.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-merge.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-move.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-push.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-remote-messages.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-remote-objects.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/command-config-prefixing-plugin.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/error-detection.plugin.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/spawn-options-plugin.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/BranchDeleteSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/CheckIgnore.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/CleanSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/ConfigList.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/DiffSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/GetRemoteSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/InitSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/MergeSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/TagList.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/promise-wrapped.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/scheduler.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/tasks-pending-queue.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/simple-git-api.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/task-callback.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/apply-patch.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/branch.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/change-working-directory.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/check-ignore.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/check-is-repo.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/clean.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/grep.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/hash-object.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/init.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/merge.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/move.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/pull.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/push.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/reset.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/status.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/sub-module.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/tag.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/types/handlers.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/types/tasks.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/argument-filters.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/git-output-streams.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/index.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/simple-git-options.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/task-options.d.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const tap = require('tap')
|
|
4
|
+
const test = tap.test
|
|
5
|
+
const {
|
|
6
|
+
stringArrayToHexStripped
|
|
7
|
+
} = require('../lib/utils')
|
|
8
|
+
|
|
9
|
+
test('stringArrayToHexStripped', (t) => {
|
|
10
|
+
const testCases = [
|
|
11
|
+
[[['0', '0', '0', '0']], ''],
|
|
12
|
+
[[['0', '0', '0', '0'], false], ''],
|
|
13
|
+
[[['0', '0', '0', '0'], true], '0'],
|
|
14
|
+
[[['0', '1', '0', '0'], false], '100'],
|
|
15
|
+
[[['1', '0', '0', '0'], false], '1000'],
|
|
16
|
+
[[['1', '0', '0', '0'], true], '1000']
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
t.plan(testCases.length)
|
|
20
|
+
|
|
21
|
+
testCases.forEach(([input, expected]) => {
|
|
22
|
+
t.strictSame(stringArrayToHexStripped(input[0], input[1]), expected)
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
type FastUri = typeof fastUri
|
|
2
|
+
|
|
3
|
+
declare namespace fastUri {
|
|
4
|
+
export interface URIComponent {
|
|
5
|
+
scheme?: string;
|
|
6
|
+
userinfo?: string;
|
|
7
|
+
host?: string;
|
|
8
|
+
port?: number | string;
|
|
9
|
+
path?: string;
|
|
10
|
+
query?: string;
|
|
11
|
+
fragment?: string;
|
|
12
|
+
reference?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Options {
|
|
16
|
+
scheme?: string;
|
|
17
|
+
reference?: string;
|
|
18
|
+
unicodeSupport?: boolean;
|
|
19
|
+
domainHost?: boolean;
|
|
20
|
+
absolutePath?: boolean;
|
|
21
|
+
tolerant?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use Options instead
|
|
26
|
+
*/
|
|
27
|
+
export type options = Options
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use URIComponent instead
|
|
30
|
+
*/
|
|
31
|
+
export type URIComponents = URIComponent
|
|
32
|
+
|
|
33
|
+
export function normalize(uri: string, opts?: Options): string;
|
|
34
|
+
export function normalize(uri: URIComponent, opts?: Options): URIComponent;
|
|
35
|
+
export function normalize(uri: any, opts?: Options): any;
|
|
36
|
+
|
|
37
|
+
export function resolve(baseURI: string, relativeURI: string, options?: Options): string
|
|
38
|
+
|
|
39
|
+
export function resolveComponent(base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent
|
|
40
|
+
|
|
41
|
+
export function parse(uri: string, opts?: Options): URIComponent;
|
|
42
|
+
|
|
43
|
+
export function serialize(component: URIComponent, opts?: Options): string;
|
|
44
|
+
|
|
45
|
+
export function equal(uriA: string, uriB: string): boolean;
|
|
46
|
+
|
|
47
|
+
export function resolve(base: string, path: string): string;
|
|
48
|
+
|
|
49
|
+
export const fastUri: FastUri
|
|
50
|
+
export { fastUri as default }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export = fastUri
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import uri, { URIComponents, URIComponent, Options, options } from "..";
|
|
2
|
+
import { expectDeprecated, expectType } from "tsd";
|
|
3
|
+
|
|
4
|
+
const parsed = uri.parse("foo");
|
|
5
|
+
expectType<URIComponents>(parsed);
|
|
6
|
+
const parsed2 = uri.parse("foo", {
|
|
7
|
+
domainHost: true,
|
|
8
|
+
scheme: 'https',
|
|
9
|
+
unicodeSupport: false
|
|
10
|
+
})
|
|
11
|
+
expectType<URIComponents>(parsed2);
|
|
12
|
+
|
|
13
|
+
expectType<URIComponent>({} as URIComponents)
|
|
14
|
+
expectDeprecated({} as URIComponents)
|
|
15
|
+
|
|
16
|
+
expectType<Options>({} as options)
|
|
17
|
+
expectDeprecated({} as options)
|
|
@@ -5,7 +5,7 @@ Node.js: fs-extra
|
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.org/package/fs-extra)
|
|
7
7
|
[](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE)
|
|
8
|
-
[](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster)
|
|
9
9
|
[](https://www.npmjs.org/package/fs-extra)
|
|
10
10
|
[](https://standardjs.com)
|
|
11
11
|
|
|
@@ -27,6 +27,8 @@ Installation
|
|
|
27
27
|
Usage
|
|
28
28
|
-----
|
|
29
29
|
|
|
30
|
+
### CommonJS
|
|
31
|
+
|
|
30
32
|
`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed.
|
|
31
33
|
|
|
32
34
|
You don't ever need to include the original `fs` module again:
|
|
@@ -55,6 +57,31 @@ const fs = require('fs')
|
|
|
55
57
|
const fse = require('fs-extra')
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
### ESM
|
|
61
|
+
|
|
62
|
+
There is also an `fs-extra/esm` import, that supports both default and named exports. However, note that `fs` methods are not included in `fs-extra/esm`; you still need to import `fs` and/or `fs/promises` seperately:
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
import { readFileSync } from 'fs'
|
|
66
|
+
import { readFile } from 'fs/promises'
|
|
67
|
+
import { outputFile, outputFileSync } from 'fs-extra/esm'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Default exports are supported:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
import fs from 'fs'
|
|
74
|
+
import fse from 'fs-extra/esm'
|
|
75
|
+
// fse.readFileSync is not a function; must use fs.readFileSync
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
but you probably want to just use regular `fs-extra` instead of `fs-extra/esm` for default exports:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
import fs from 'fs-extra'
|
|
82
|
+
// both fs and fs-extra methods are defined
|
|
83
|
+
```
|
|
84
|
+
|
|
58
85
|
Sync vs Async vs Async/Await
|
|
59
86
|
-------------
|
|
60
87
|
Most methods are async by default. All async methods will return a promise if the callback isn't passed.
|
|
@@ -197,7 +224,10 @@ fs-extra contains hundreds of tests.
|
|
|
197
224
|
|
|
198
225
|
- `npm run lint`: runs the linter ([standard](http://standardjs.com/))
|
|
199
226
|
- `npm run unit`: runs the unit tests
|
|
200
|
-
- `npm
|
|
227
|
+
- `npm run unit-esm`: runs tests for `fs-extra/esm` exports
|
|
228
|
+
- `npm test`: runs the linter and all tests
|
|
229
|
+
|
|
230
|
+
When running unit tests, set the environment variable `CROSS_DEVICE_PATH` to the absolute path of an empty directory on another device (like a thumb drive) to enable cross-device move tests.
|
|
201
231
|
|
|
202
232
|
|
|
203
233
|
### Windows
|
|
@@ -26,21 +26,12 @@ function copySync (src, dest, opts) {
|
|
|
26
26
|
|
|
27
27
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
|
|
28
28
|
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
|
|
29
|
-
return handleFilterAndCopy(destStat, src, dest, opts)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function handleFilterAndCopy (destStat, src, dest, opts) {
|
|
33
29
|
if (opts.filter && !opts.filter(src, dest)) return
|
|
34
30
|
const destParent = path.dirname(dest)
|
|
35
31
|
if (!fs.existsSync(destParent)) mkdirsSync(destParent)
|
|
36
32
|
return getStats(destStat, src, dest, opts)
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
function startCopy (destStat, src, dest, opts) {
|
|
40
|
-
if (opts.filter && !opts.filter(src, dest)) return
|
|
41
|
-
return getStats(destStat, src, dest, opts)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
function getStats (destStat, src, dest, opts) {
|
|
45
36
|
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
|
|
46
37
|
const srcStat = statSync(src)
|
|
@@ -121,8 +112,9 @@ function copyDir (src, dest, opts) {
|
|
|
121
112
|
function copyDirItem (item, src, dest, opts) {
|
|
122
113
|
const srcItem = path.join(src, item)
|
|
123
114
|
const destItem = path.join(dest, item)
|
|
115
|
+
if (opts.filter && !opts.filter(srcItem, destItem)) return
|
|
124
116
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
|
|
125
|
-
return
|
|
117
|
+
return getStats(destStat, srcItem, destItem, opts)
|
|
126
118
|
}
|
|
127
119
|
|
|
128
120
|
function onLink (destStat, src, dest, opts) {
|
|
@@ -154,7 +146,7 @@ function onLink (destStat, src, dest, opts) {
|
|
|
154
146
|
// prevent copy if src is a subdir of dest since unlinking
|
|
155
147
|
// dest in this case would result in removing src contents
|
|
156
148
|
// and therefore a broken symlink would be created.
|
|
157
|
-
if (
|
|
149
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
158
150
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
|
159
151
|
}
|
|
160
152
|
return copyLink(resolvedSrc, dest)
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const fs = require('
|
|
3
|
+
const fs = require('../fs')
|
|
4
4
|
const path = require('path')
|
|
5
|
-
const mkdirs = require('../mkdirs')
|
|
6
|
-
const pathExists = require('../path-exists')
|
|
7
|
-
const utimesMillis = require('../util/utimes')
|
|
5
|
+
const { mkdirs } = require('../mkdirs')
|
|
6
|
+
const { pathExists } = require('../path-exists')
|
|
7
|
+
const { utimesMillis } = require('../util/utimes')
|
|
8
8
|
const stat = require('../util/stat')
|
|
9
9
|
|
|
10
|
-
function copy (src, dest, opts
|
|
11
|
-
if (typeof opts === 'function'
|
|
12
|
-
cb = opts
|
|
13
|
-
opts = {}
|
|
14
|
-
} else if (typeof opts === 'function') {
|
|
10
|
+
async function copy (src, dest, opts = {}) {
|
|
11
|
+
if (typeof opts === 'function') {
|
|
15
12
|
opts = { filter: opts }
|
|
16
13
|
}
|
|
17
14
|
|
|
18
|
-
cb = cb || function () {}
|
|
19
|
-
opts = opts || {}
|
|
20
|
-
|
|
21
15
|
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
|
22
16
|
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
|
23
17
|
|
|
@@ -30,206 +24,154 @@ function copy (src, dest, opts, cb) {
|
|
|
30
24
|
)
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
stat.checkPaths(src, dest, 'copy', opts
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
}
|
|
27
|
+
const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)
|
|
28
|
+
|
|
29
|
+
await stat.checkParentPaths(src, srcStat, dest, 'copy')
|
|
30
|
+
|
|
31
|
+
const include = await runFilter(src, dest, opts)
|
|
32
|
+
|
|
33
|
+
if (!include) return
|
|
43
34
|
|
|
44
|
-
|
|
35
|
+
// check if the parent of dest exists, and create it if it doesn't exist
|
|
45
36
|
const destParent = path.dirname(dest)
|
|
46
|
-
pathExists(destParent
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (err) return cb(err)
|
|
51
|
-
return getStats(destStat, src, dest, opts, cb)
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
}
|
|
37
|
+
const dirExists = await pathExists(destParent)
|
|
38
|
+
if (!dirExists) {
|
|
39
|
+
await mkdirs(destParent)
|
|
40
|
+
}
|
|
55
41
|
|
|
56
|
-
|
|
57
|
-
Promise.resolve(opts.filter(src, dest)).then(include => {
|
|
58
|
-
if (include) return onInclude(destStat, src, dest, opts, cb)
|
|
59
|
-
return cb()
|
|
60
|
-
}, error => cb(error))
|
|
42
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts)
|
|
61
43
|
}
|
|
62
44
|
|
|
63
|
-
function
|
|
64
|
-
if (opts.filter) return
|
|
65
|
-
return
|
|
45
|
+
async function runFilter (src, dest, opts) {
|
|
46
|
+
if (!opts.filter) return true
|
|
47
|
+
return opts.filter(src, dest)
|
|
66
48
|
}
|
|
67
49
|
|
|
68
|
-
function
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)
|
|
74
|
-
else if (srcStat.isFile() ||
|
|
75
|
-
srcStat.isCharacterDevice() ||
|
|
76
|
-
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)
|
|
77
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)
|
|
78
|
-
else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`))
|
|
79
|
-
else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`))
|
|
80
|
-
return cb(new Error(`Unknown file: ${src}`))
|
|
81
|
-
})
|
|
82
|
-
}
|
|
50
|
+
async function getStatsAndPerformCopy (destStat, src, dest, opts) {
|
|
51
|
+
const statFn = opts.dereference ? fs.stat : fs.lstat
|
|
52
|
+
const srcStat = await statFn(src)
|
|
53
|
+
|
|
54
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
|
83
55
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
56
|
+
if (
|
|
57
|
+
srcStat.isFile() ||
|
|
58
|
+
srcStat.isCharacterDevice() ||
|
|
59
|
+
srcStat.isBlockDevice()
|
|
60
|
+
) return onFile(srcStat, destStat, src, dest, opts)
|
|
61
|
+
|
|
62
|
+
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
|
63
|
+
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
|
64
|
+
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
|
65
|
+
throw new Error(`Unknown file: ${src}`)
|
|
87
66
|
}
|
|
88
67
|
|
|
89
|
-
function
|
|
68
|
+
async function onFile (srcStat, destStat, src, dest, opts) {
|
|
69
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
|
70
|
+
|
|
90
71
|
if (opts.overwrite) {
|
|
91
|
-
fs.unlink(dest
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} else return cb()
|
|
72
|
+
await fs.unlink(dest)
|
|
73
|
+
return copyFile(srcStat, src, dest, opts)
|
|
74
|
+
}
|
|
75
|
+
if (opts.errorOnExist) {
|
|
76
|
+
throw new Error(`'${dest}' already exists`)
|
|
77
|
+
}
|
|
98
78
|
}
|
|
99
79
|
|
|
100
|
-
function copyFile (srcStat, src, dest, opts
|
|
101
|
-
fs.copyFile(src, dest
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
80
|
+
async function copyFile (srcStat, src, dest, opts) {
|
|
81
|
+
await fs.copyFile(src, dest)
|
|
82
|
+
if (opts.preserveTimestamps) {
|
|
83
|
+
// Make sure the file is writable before setting the timestamp
|
|
84
|
+
// otherwise open fails with EPERM when invoked with 'r+'
|
|
85
|
+
// (through utimes call)
|
|
86
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
|
87
|
+
await makeFileWritable(dest, srcStat.mode)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Set timestamps and mode correspondingly
|
|
107
91
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return makeFileWritable(dest, srcMode, err => {
|
|
114
|
-
if (err) return cb(err)
|
|
115
|
-
return setDestTimestampsAndMode(srcMode, src, dest, cb)
|
|
116
|
-
})
|
|
92
|
+
// Note that The initial srcStat.atime cannot be trusted
|
|
93
|
+
// because it is modified by the read(2) system call
|
|
94
|
+
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
|
95
|
+
const updatedSrcStat = await fs.stat(src)
|
|
96
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
|
117
97
|
}
|
|
118
|
-
|
|
98
|
+
|
|
99
|
+
return fs.chmod(dest, srcStat.mode)
|
|
119
100
|
}
|
|
120
101
|
|
|
121
102
|
function fileIsNotWritable (srcMode) {
|
|
122
103
|
return (srcMode & 0o200) === 0
|
|
123
104
|
}
|
|
124
105
|
|
|
125
|
-
function makeFileWritable (dest, srcMode
|
|
126
|
-
return
|
|
106
|
+
function makeFileWritable (dest, srcMode) {
|
|
107
|
+
return fs.chmod(dest, srcMode | 0o200)
|
|
127
108
|
}
|
|
128
109
|
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
}
|
|
110
|
+
async function onDir (srcStat, destStat, src, dest, opts) {
|
|
111
|
+
// the dest directory might not exist, create it
|
|
112
|
+
if (!destStat) {
|
|
113
|
+
await fs.mkdir(dest)
|
|
114
|
+
}
|
|
135
115
|
|
|
136
|
-
|
|
137
|
-
return fs.chmod(dest, srcMode, cb)
|
|
138
|
-
}
|
|
116
|
+
const items = await fs.readdir(src)
|
|
139
117
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
fs.stat(src, (err, updatedSrcStat) => {
|
|
145
|
-
if (err) return cb(err)
|
|
146
|
-
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)
|
|
147
|
-
})
|
|
148
|
-
}
|
|
118
|
+
// loop through the files in the current directory to copy everything
|
|
119
|
+
await Promise.all(items.map(async item => {
|
|
120
|
+
const srcItem = path.join(src, item)
|
|
121
|
+
const destItem = path.join(dest, item)
|
|
149
122
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
123
|
+
// skip the item if it is matches by the filter function
|
|
124
|
+
const include = await runFilter(srcItem, destItem, opts)
|
|
125
|
+
if (!include) return
|
|
154
126
|
|
|
155
|
-
|
|
156
|
-
fs.mkdir(dest, err => {
|
|
157
|
-
if (err) return cb(err)
|
|
158
|
-
copyDir(src, dest, opts, err => {
|
|
159
|
-
if (err) return cb(err)
|
|
160
|
-
return setDestMode(dest, srcMode, cb)
|
|
161
|
-
})
|
|
162
|
-
})
|
|
163
|
-
}
|
|
127
|
+
const { destStat } = await stat.checkPaths(srcItem, destItem, 'copy', opts)
|
|
164
128
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
})
|
|
170
|
-
}
|
|
129
|
+
// If the item is a copyable file, `getStatsAndPerformCopy` will copy it
|
|
130
|
+
// If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
|
|
131
|
+
return getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
|
|
132
|
+
}))
|
|
171
133
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return copyDirItem(items, item, src, dest, opts, cb)
|
|
134
|
+
if (!destStat) {
|
|
135
|
+
await fs.chmod(dest, srcStat.mode)
|
|
136
|
+
}
|
|
176
137
|
}
|
|
177
138
|
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return copyDirItems(items, src, dest, opts, cb)
|
|
187
|
-
})
|
|
188
|
-
})
|
|
189
|
-
}
|
|
139
|
+
async function onLink (destStat, src, dest, opts) {
|
|
140
|
+
let resolvedSrc = await fs.readlink(src)
|
|
141
|
+
if (opts.dereference) {
|
|
142
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
|
143
|
+
}
|
|
144
|
+
if (!destStat) {
|
|
145
|
+
return fs.symlink(resolvedSrc, dest)
|
|
146
|
+
}
|
|
190
147
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
148
|
+
let resolvedDest = null
|
|
149
|
+
try {
|
|
150
|
+
resolvedDest = await fs.readlink(dest)
|
|
151
|
+
} catch (e) {
|
|
152
|
+
// dest exists and is a regular file or directory,
|
|
153
|
+
// Windows may throw UNKNOWN error. If dest already exists,
|
|
154
|
+
// fs throws error anyway, so no need to guard against it here.
|
|
155
|
+
if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)
|
|
156
|
+
throw e
|
|
157
|
+
}
|
|
158
|
+
if (opts.dereference) {
|
|
159
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
|
160
|
+
}
|
|
161
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
162
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
|
163
|
+
}
|
|
197
164
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
// Windows may throw UNKNOWN error. If dest already exists,
|
|
205
|
-
// fs throws error anyway, so no need to guard against it here.
|
|
206
|
-
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)
|
|
207
|
-
return cb(err)
|
|
208
|
-
}
|
|
209
|
-
if (opts.dereference) {
|
|
210
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
|
211
|
-
}
|
|
212
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
213
|
-
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// do not copy if src is a subdir of dest since unlinking
|
|
217
|
-
// dest in this case would result in removing src contents
|
|
218
|
-
// and therefore a broken symlink would be created.
|
|
219
|
-
if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
220
|
-
return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))
|
|
221
|
-
}
|
|
222
|
-
return copyLink(resolvedSrc, dest, cb)
|
|
223
|
-
})
|
|
224
|
-
}
|
|
225
|
-
})
|
|
226
|
-
}
|
|
165
|
+
// do not copy if src is a subdir of dest since unlinking
|
|
166
|
+
// dest in this case would result in removing src contents
|
|
167
|
+
// and therefore a broken symlink would be created.
|
|
168
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
169
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
|
170
|
+
}
|
|
227
171
|
|
|
228
|
-
|
|
229
|
-
fs.unlink(dest
|
|
230
|
-
|
|
231
|
-
return fs.symlink(resolvedSrc, dest, cb)
|
|
232
|
-
})
|
|
172
|
+
// copy the link
|
|
173
|
+
await fs.unlink(dest)
|
|
174
|
+
return fs.symlink(resolvedSrc, dest)
|
|
233
175
|
}
|
|
234
176
|
|
|
235
177
|
module.exports = copy
|
|
@@ -1,50 +1,47 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const u = require('universalify').
|
|
3
|
+
const u = require('universalify').fromPromise
|
|
4
4
|
const path = require('path')
|
|
5
|
-
const fs = require('
|
|
5
|
+
const fs = require('../fs')
|
|
6
6
|
const mkdir = require('../mkdirs')
|
|
7
7
|
|
|
8
|
-
function createFile (file
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
8
|
+
async function createFile (file) {
|
|
9
|
+
let stats
|
|
10
|
+
try {
|
|
11
|
+
stats = await fs.stat(file)
|
|
12
|
+
} catch { }
|
|
13
|
+
if (stats && stats.isFile()) return
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
if (!err && stats.isFile()) return callback()
|
|
18
|
-
const dir = path.dirname(file)
|
|
19
|
-
fs.stat(dir, (err, stats) => {
|
|
20
|
-
if (err) {
|
|
21
|
-
// if the directory doesn't exist, make it
|
|
22
|
-
if (err.code === 'ENOENT') {
|
|
23
|
-
return mkdir.mkdirs(dir, err => {
|
|
24
|
-
if (err) return callback(err)
|
|
25
|
-
makeFile()
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
return callback(err)
|
|
29
|
-
}
|
|
15
|
+
const dir = path.dirname(file)
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
17
|
+
let dirStats = null
|
|
18
|
+
try {
|
|
19
|
+
dirStats = await fs.stat(dir)
|
|
20
|
+
} catch (err) {
|
|
21
|
+
// if the directory doesn't exist, make it
|
|
22
|
+
if (err.code === 'ENOENT') {
|
|
23
|
+
await mkdir.mkdirs(dir)
|
|
24
|
+
await fs.writeFile(file, '')
|
|
25
|
+
return
|
|
26
|
+
} else {
|
|
27
|
+
throw err
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (dirStats.isDirectory()) {
|
|
32
|
+
await fs.writeFile(file, '')
|
|
33
|
+
} else {
|
|
34
|
+
// parent is not a directory
|
|
35
|
+
// This is just to cause an internal ENOTDIR error to be thrown
|
|
36
|
+
await fs.readdir(dir)
|
|
37
|
+
}
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
function createFileSync (file) {
|
|
44
41
|
let stats
|
|
45
42
|
try {
|
|
46
43
|
stats = fs.statSync(file)
|
|
47
|
-
} catch {}
|
|
44
|
+
} catch { }
|
|
48
45
|
if (stats && stats.isFile()) return
|
|
49
46
|
|
|
50
47
|
const dir = path.dirname(file)
|