@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
|
@@ -1,39 +1,39 @@
|
|
|
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
|
-
const pathExists = require('../path-exists')
|
|
7
|
+
const { pathExists } = require('../path-exists')
|
|
8
8
|
const { areIdentical } = require('../util/stat')
|
|
9
9
|
|
|
10
|
-
function createLink (srcpath, dstpath
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
async function createLink (srcpath, dstpath) {
|
|
11
|
+
let dstStat
|
|
12
|
+
try {
|
|
13
|
+
dstStat = await fs.lstat(dstpath)
|
|
14
|
+
} catch {
|
|
15
|
+
// ignore error
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
let srcStat
|
|
19
|
+
try {
|
|
20
|
+
srcStat = await fs.lstat(srcpath)
|
|
21
|
+
} catch (err) {
|
|
22
|
+
err.message = err.message.replace('lstat', 'ensureLink')
|
|
23
|
+
throw err
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return
|
|
27
|
+
|
|
28
|
+
const dir = path.dirname(dstpath)
|
|
29
|
+
|
|
30
|
+
const dirExists = await pathExists(dir)
|
|
31
|
+
|
|
32
|
+
if (!dirExists) {
|
|
33
|
+
await mkdir.mkdirs(dir)
|
|
34
|
+
}
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
pathExists(dir, (err, dirExists) => {
|
|
28
|
-
if (err) return callback(err)
|
|
29
|
-
if (dirExists) return makeLink(srcpath, dstpath)
|
|
30
|
-
mkdir.mkdirs(dir, err => {
|
|
31
|
-
if (err) return callback(err)
|
|
32
|
-
makeLink(srcpath, dstpath)
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
})
|
|
36
|
+
await fs.link(srcpath, dstpath)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function createLinkSync (srcpath, dstpath) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const path = require('path')
|
|
4
|
-
const fs = require('
|
|
5
|
-
const pathExists = require('../path-exists')
|
|
4
|
+
const fs = require('../fs')
|
|
5
|
+
const { pathExists } = require('../path-exists')
|
|
6
|
+
|
|
7
|
+
const u = require('universalify').fromPromise
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Function that returns two types of paths, one relative to symlink, and one
|
|
@@ -26,74 +28,74 @@ const pathExists = require('../path-exists').pathExists
|
|
|
26
28
|
* the ability to pass in `relative to current working direcotry` paths.
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
function symlinkPaths (srcpath, dstpath
|
|
31
|
+
async function symlinkPaths (srcpath, dstpath) {
|
|
30
32
|
if (path.isAbsolute(srcpath)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
try {
|
|
34
|
+
await fs.lstat(srcpath)
|
|
35
|
+
} catch (err) {
|
|
36
|
+
err.message = err.message.replace('lstat', 'ensureSymlink')
|
|
37
|
+
throw err
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
toCwd: srcpath,
|
|
42
|
+
toDst: srcpath
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const dstdir = path.dirname(dstpath)
|
|
47
|
+
const relativeToDst = path.join(dstdir, srcpath)
|
|
48
|
+
|
|
49
|
+
const exists = await pathExists(relativeToDst)
|
|
50
|
+
if (exists) {
|
|
51
|
+
return {
|
|
52
|
+
toCwd: relativeToDst,
|
|
53
|
+
toDst: srcpath
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
await fs.lstat(srcpath)
|
|
59
|
+
} catch (err) {
|
|
60
|
+
err.message = err.message.replace('lstat', 'ensureSymlink')
|
|
61
|
+
throw err
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
toCwd: srcpath,
|
|
66
|
+
toDst: path.relative(dstdir, srcpath)
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
function symlinkPathsSync (srcpath, dstpath) {
|
|
68
|
-
let exists
|
|
69
71
|
if (path.isAbsolute(srcpath)) {
|
|
70
|
-
exists = fs.existsSync(srcpath)
|
|
72
|
+
const exists = fs.existsSync(srcpath)
|
|
71
73
|
if (!exists) throw new Error('absolute srcpath does not exist')
|
|
72
74
|
return {
|
|
73
75
|
toCwd: srcpath,
|
|
74
76
|
toDst: srcpath
|
|
75
77
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} else {
|
|
86
|
-
exists = fs.existsSync(srcpath)
|
|
87
|
-
if (!exists) throw new Error('relative srcpath does not exist')
|
|
88
|
-
return {
|
|
89
|
-
toCwd: srcpath,
|
|
90
|
-
toDst: path.relative(dstdir, srcpath)
|
|
91
|
-
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const dstdir = path.dirname(dstpath)
|
|
81
|
+
const relativeToDst = path.join(dstdir, srcpath)
|
|
82
|
+
const exists = fs.existsSync(relativeToDst)
|
|
83
|
+
if (exists) {
|
|
84
|
+
return {
|
|
85
|
+
toCwd: relativeToDst,
|
|
86
|
+
toDst: srcpath
|
|
92
87
|
}
|
|
93
88
|
}
|
|
89
|
+
|
|
90
|
+
const srcExists = fs.existsSync(srcpath)
|
|
91
|
+
if (!srcExists) throw new Error('relative srcpath does not exist')
|
|
92
|
+
return {
|
|
93
|
+
toCwd: srcpath,
|
|
94
|
+
toDst: path.relative(dstdir, srcpath)
|
|
95
|
+
}
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
module.exports = {
|
|
97
|
-
symlinkPaths,
|
|
99
|
+
symlinkPaths: u(symlinkPaths),
|
|
98
100
|
symlinkPathsSync
|
|
99
101
|
}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const fs = require('
|
|
3
|
+
const fs = require('../fs')
|
|
4
|
+
const u = require('universalify').fromPromise
|
|
4
5
|
|
|
5
|
-
function symlinkType (srcpath, type
|
|
6
|
-
|
|
7
|
-
type = (typeof type === 'function') ? false : type
|
|
8
|
-
if (type) return callback(null, type)
|
|
9
|
-
fs.lstat(srcpath, (err, stats) => {
|
|
10
|
-
if (err) return callback(null, 'file')
|
|
11
|
-
type = (stats && stats.isDirectory()) ? 'dir' : 'file'
|
|
12
|
-
callback(null, type)
|
|
13
|
-
})
|
|
14
|
-
}
|
|
6
|
+
async function symlinkType (srcpath, type) {
|
|
7
|
+
if (type) return type
|
|
15
8
|
|
|
16
|
-
function symlinkTypeSync (srcpath, type) {
|
|
17
9
|
let stats
|
|
10
|
+
try {
|
|
11
|
+
stats = await fs.lstat(srcpath)
|
|
12
|
+
} catch {
|
|
13
|
+
return 'file'
|
|
14
|
+
}
|
|
18
15
|
|
|
16
|
+
return (stats && stats.isDirectory()) ? 'dir' : 'file'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function symlinkTypeSync (srcpath, type) {
|
|
19
20
|
if (type) return type
|
|
21
|
+
|
|
22
|
+
let stats
|
|
20
23
|
try {
|
|
21
24
|
stats = fs.lstatSync(srcpath)
|
|
22
25
|
} catch {
|
|
@@ -26,6 +29,6 @@ function symlinkTypeSync (srcpath, type) {
|
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
module.exports = {
|
|
29
|
-
symlinkType,
|
|
32
|
+
symlinkType: u(symlinkType),
|
|
30
33
|
symlinkTypeSync
|
|
31
34
|
}
|
|
@@ -1,65 +1,50 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const u = require('universalify').
|
|
3
|
+
const u = require('universalify').fromPromise
|
|
4
4
|
const path = require('path')
|
|
5
5
|
const fs = require('../fs')
|
|
6
|
-
const _mkdirs = require('../mkdirs')
|
|
7
|
-
const mkdirs = _mkdirs.mkdirs
|
|
8
|
-
const mkdirsSync = _mkdirs.mkdirsSync
|
|
9
6
|
|
|
10
|
-
const
|
|
11
|
-
const symlinkPaths = _symlinkPaths.symlinkPaths
|
|
12
|
-
const symlinkPathsSync = _symlinkPaths.symlinkPathsSync
|
|
7
|
+
const { mkdirs, mkdirsSync } = require('../mkdirs')
|
|
13
8
|
|
|
14
|
-
const
|
|
15
|
-
const symlinkType =
|
|
16
|
-
const symlinkTypeSync = _symlinkType.symlinkTypeSync
|
|
9
|
+
const { symlinkPaths, symlinkPathsSync } = require('./symlink-paths')
|
|
10
|
+
const { symlinkType, symlinkTypeSync } = require('./symlink-type')
|
|
17
11
|
|
|
18
|
-
const pathExists = require('../path-exists')
|
|
12
|
+
const { pathExists } = require('../path-exists')
|
|
19
13
|
|
|
20
14
|
const { areIdentical } = require('../util/stat')
|
|
21
15
|
|
|
22
|
-
function createSymlink (srcpath, dstpath, type
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
async function createSymlink (srcpath, dstpath, type) {
|
|
17
|
+
let stats
|
|
18
|
+
try {
|
|
19
|
+
stats = await fs.lstat(dstpath)
|
|
20
|
+
} catch { }
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
if (stats && stats.isSymbolicLink()) {
|
|
23
|
+
const [srcStat, dstStat] = await Promise.all([
|
|
24
|
+
fs.stat(srcpath),
|
|
25
|
+
fs.stat(dstpath)
|
|
26
|
+
])
|
|
27
|
+
|
|
28
|
+
if (areIdentical(srcStat, dstStat)) return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const relative = await symlinkPaths(srcpath, dstpath)
|
|
32
|
+
srcpath = relative.toDst
|
|
33
|
+
const toType = await symlinkType(relative.toCwd, type)
|
|
34
|
+
const dir = path.dirname(dstpath)
|
|
35
|
+
|
|
36
|
+
if (!(await pathExists(dir))) {
|
|
37
|
+
await mkdirs(dir)
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
|
41
|
-
if (err) return callback(err)
|
|
42
|
-
srcpath = relative.toDst
|
|
43
|
-
symlinkType(relative.toCwd, type, (err, type) => {
|
|
44
|
-
if (err) return callback(err)
|
|
45
|
-
const dir = path.dirname(dstpath)
|
|
46
|
-
pathExists(dir, (err, dirExists) => {
|
|
47
|
-
if (err) return callback(err)
|
|
48
|
-
if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
|
|
49
|
-
mkdirs(dir, err => {
|
|
50
|
-
if (err) return callback(err)
|
|
51
|
-
fs.symlink(srcpath, dstpath, type, callback)
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
})
|
|
40
|
+
return fs.symlink(srcpath, dstpath, toType)
|
|
56
41
|
}
|
|
57
42
|
|
|
58
43
|
function createSymlinkSync (srcpath, dstpath, type) {
|
|
59
44
|
let stats
|
|
60
45
|
try {
|
|
61
46
|
stats = fs.lstatSync(dstpath)
|
|
62
|
-
} catch {}
|
|
47
|
+
} catch { }
|
|
63
48
|
if (stats && stats.isSymbolicLink()) {
|
|
64
49
|
const srcStat = fs.statSync(srcpath)
|
|
65
50
|
const dstStat = fs.statSync(dstpath)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _copy from './copy/index.js'
|
|
2
|
+
import _empty from './empty/index.js'
|
|
3
|
+
import _ensure from './ensure/index.js'
|
|
4
|
+
import _json from './json/index.js'
|
|
5
|
+
import _mkdirs from './mkdirs/index.js'
|
|
6
|
+
import _move from './move/index.js'
|
|
7
|
+
import _outputFile from './output-file/index.js'
|
|
8
|
+
import _pathExists from './path-exists/index.js'
|
|
9
|
+
import _remove from './remove/index.js'
|
|
10
|
+
|
|
11
|
+
// NOTE: Only exports fs-extra's functions; fs functions must be imported from "node:fs" or "node:fs/promises"
|
|
12
|
+
|
|
13
|
+
export const copy = _copy.copy
|
|
14
|
+
export const copySync = _copy.copySync
|
|
15
|
+
export const emptyDirSync = _empty.emptyDirSync
|
|
16
|
+
export const emptydirSync = _empty.emptydirSync
|
|
17
|
+
export const emptyDir = _empty.emptyDir
|
|
18
|
+
export const emptydir = _empty.emptydir
|
|
19
|
+
export const createFile = _ensure.createFile
|
|
20
|
+
export const createFileSync = _ensure.createFileSync
|
|
21
|
+
export const ensureFile = _ensure.ensureFile
|
|
22
|
+
export const ensureFileSync = _ensure.ensureFileSync
|
|
23
|
+
export const createLink = _ensure.createLink
|
|
24
|
+
export const createLinkSync = _ensure.createLinkSync
|
|
25
|
+
export const ensureLink = _ensure.ensureLink
|
|
26
|
+
export const ensureLinkSync = _ensure.ensureLinkSync
|
|
27
|
+
export const createSymlink = _ensure.createSymlink
|
|
28
|
+
export const createSymlinkSync = _ensure.createSymlinkSync
|
|
29
|
+
export const ensureSymlink = _ensure.ensureSymlink
|
|
30
|
+
export const ensureSymlinkSync = _ensure.ensureSymlinkSync
|
|
31
|
+
export const readJson = _json.readJson
|
|
32
|
+
export const readJSON = _json.readJSON
|
|
33
|
+
export const readJsonSync = _json.readJsonSync
|
|
34
|
+
export const readJSONSync = _json.readJSONSync
|
|
35
|
+
export const writeJson = _json.writeJson
|
|
36
|
+
export const writeJSON = _json.writeJSON
|
|
37
|
+
export const writeJsonSync = _json.writeJsonSync
|
|
38
|
+
export const writeJSONSync = _json.writeJSONSync
|
|
39
|
+
export const outputJson = _json.outputJson
|
|
40
|
+
export const outputJSON = _json.outputJSON
|
|
41
|
+
export const outputJsonSync = _json.outputJsonSync
|
|
42
|
+
export const outputJSONSync = _json.outputJSONSync
|
|
43
|
+
export const mkdirs = _mkdirs.mkdirs
|
|
44
|
+
export const mkdirsSync = _mkdirs.mkdirsSync
|
|
45
|
+
export const mkdirp = _mkdirs.mkdirp
|
|
46
|
+
export const mkdirpSync = _mkdirs.mkdirpSync
|
|
47
|
+
export const ensureDir = _mkdirs.ensureDir
|
|
48
|
+
export const ensureDirSync = _mkdirs.ensureDirSync
|
|
49
|
+
export const move = _move.move
|
|
50
|
+
export const moveSync = _move.moveSync
|
|
51
|
+
export const outputFile = _outputFile.outputFile
|
|
52
|
+
export const outputFileSync = _outputFile.outputFileSync
|
|
53
|
+
export const pathExists = _pathExists.pathExists
|
|
54
|
+
export const pathExistsSync = _pathExists.pathExistsSync
|
|
55
|
+
export const remove = _remove.remove
|
|
56
|
+
export const removeSync = _remove.removeSync
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
..._copy,
|
|
60
|
+
..._empty,
|
|
61
|
+
..._ensure,
|
|
62
|
+
..._json,
|
|
63
|
+
..._mkdirs,
|
|
64
|
+
..._move,
|
|
65
|
+
..._outputFile,
|
|
66
|
+
..._pathExists,
|
|
67
|
+
..._remove
|
|
68
|
+
}
|
|
@@ -41,8 +41,7 @@ const api = [
|
|
|
41
41
|
'writeFile'
|
|
42
42
|
].filter(key => {
|
|
43
43
|
// Some commands are not available on some systems. Ex:
|
|
44
|
-
// fs.
|
|
45
|
-
// fs.rm was added in Node.js v14.14.0
|
|
44
|
+
// fs.cp was added in Node.js v16.7.0
|
|
46
45
|
// fs.lchown is not available on at least some Linux
|
|
47
46
|
return typeof fs[key] === 'function'
|
|
48
47
|
})
|
|
@@ -66,7 +65,7 @@ exports.exists = function (filename, callback) {
|
|
|
66
65
|
})
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args
|
|
68
|
+
// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
|
|
70
69
|
|
|
71
70
|
exports.read = function (fd, buffer, offset, length, position, callback) {
|
|
72
71
|
if (typeof callback === 'function') {
|
|
@@ -98,23 +97,36 @@ exports.write = function (fd, buffer, ...args) {
|
|
|
98
97
|
})
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return fs.writev(fd, buffers, ...args)
|
|
109
|
-
}
|
|
100
|
+
// Function signature is
|
|
101
|
+
// s.readv(fd, buffers[, position], callback)
|
|
102
|
+
// We need to handle the optional arg, so we use ...args
|
|
103
|
+
exports.readv = function (fd, buffers, ...args) {
|
|
104
|
+
if (typeof args[args.length - 1] === 'function') {
|
|
105
|
+
return fs.readv(fd, buffers, ...args)
|
|
106
|
+
}
|
|
110
107
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
})
|
|
108
|
+
return new Promise((resolve, reject) => {
|
|
109
|
+
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
|
|
110
|
+
if (err) return reject(err)
|
|
111
|
+
resolve({ bytesRead, buffers })
|
|
116
112
|
})
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Function signature is
|
|
117
|
+
// s.writev(fd, buffers[, position], callback)
|
|
118
|
+
// We need to handle the optional arg, so we use ...args
|
|
119
|
+
exports.writev = function (fd, buffers, ...args) {
|
|
120
|
+
if (typeof args[args.length - 1] === 'function') {
|
|
121
|
+
return fs.writev(fd, buffers, ...args)
|
|
117
122
|
}
|
|
123
|
+
|
|
124
|
+
return new Promise((resolve, reject) => {
|
|
125
|
+
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
|
|
126
|
+
if (err) return reject(err)
|
|
127
|
+
resolve({ bytesWritten, buffers })
|
|
128
|
+
})
|
|
129
|
+
})
|
|
118
130
|
}
|
|
119
131
|
|
|
120
132
|
// fs.realpath.native sometimes not available if fs is monkey-patched
|
|
@@ -45,7 +45,8 @@ function rename (src, dest, overwrite) {
|
|
|
45
45
|
function moveAcrossDevice (src, dest, overwrite) {
|
|
46
46
|
const opts = {
|
|
47
47
|
overwrite,
|
|
48
|
-
errorOnExist: true
|
|
48
|
+
errorOnExist: true,
|
|
49
|
+
preserveTimestamps: true
|
|
49
50
|
}
|
|
50
51
|
copySync(src, dest, opts)
|
|
51
52
|
return removeSync(src)
|
|
@@ -1,75 +1,59 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const fs = require('
|
|
3
|
+
const fs = require('../fs')
|
|
4
4
|
const path = require('path')
|
|
5
|
-
const copy = require('../copy')
|
|
6
|
-
const remove = require('../remove')
|
|
7
|
-
const mkdirp = require('../mkdirs')
|
|
8
|
-
const pathExists = require('../path-exists')
|
|
5
|
+
const { copy } = require('../copy')
|
|
6
|
+
const { remove } = require('../remove')
|
|
7
|
+
const { mkdirp } = require('../mkdirs')
|
|
8
|
+
const { pathExists } = require('../path-exists')
|
|
9
9
|
const stat = require('../util/stat')
|
|
10
10
|
|
|
11
|
-
function move (src, dest, opts
|
|
12
|
-
|
|
13
|
-
cb = opts
|
|
14
|
-
opts = {}
|
|
15
|
-
}
|
|
11
|
+
async function move (src, dest, opts = {}) {
|
|
12
|
+
const overwrite = opts.overwrite || opts.clobber || false
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
await stat.checkParentPaths(src, srcStat, dest, 'move')
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
mkdirp(path.dirname(dest), err => {
|
|
28
|
-
if (err) return cb(err)
|
|
29
|
-
return doRename(src, dest, overwrite, isChangingCase, cb)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
}
|
|
18
|
+
// If the parent of dest is not root, make sure it exists before proceeding
|
|
19
|
+
const destParent = path.dirname(dest)
|
|
20
|
+
const parsedParentPath = path.parse(destParent)
|
|
21
|
+
if (parsedParentPath.root !== destParent) {
|
|
22
|
+
await mkdirp(destParent)
|
|
23
|
+
}
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
const parent = path.dirname(dest)
|
|
37
|
-
const parsedPath = path.parse(parent)
|
|
38
|
-
return parsedPath.root === parent
|
|
25
|
+
return doRename(src, dest, overwrite, isChangingCase)
|
|
39
26
|
}
|
|
40
27
|
|
|
41
|
-
function doRename (src, dest, overwrite, isChangingCase
|
|
42
|
-
if (isChangingCase)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
28
|
+
async function doRename (src, dest, overwrite, isChangingCase) {
|
|
29
|
+
if (!isChangingCase) {
|
|
30
|
+
if (overwrite) {
|
|
31
|
+
await remove(dest)
|
|
32
|
+
} else if (await pathExists(dest)) {
|
|
33
|
+
throw new Error('dest already exists.')
|
|
34
|
+
}
|
|
48
35
|
}
|
|
49
|
-
pathExists(dest, (err, destExists) => {
|
|
50
|
-
if (err) return cb(err)
|
|
51
|
-
if (destExists) return cb(new Error('dest already exists.'))
|
|
52
|
-
return rename(src, dest, overwrite, cb)
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
36
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
37
|
+
try {
|
|
38
|
+
// Try w/ rename first, and try copy + remove if EXDEV
|
|
39
|
+
await fs.rename(src, dest)
|
|
40
|
+
} catch (err) {
|
|
41
|
+
if (err.code !== 'EXDEV') {
|
|
42
|
+
throw err
|
|
43
|
+
}
|
|
44
|
+
await moveAcrossDevice(src, dest, overwrite)
|
|
45
|
+
}
|
|
62
46
|
}
|
|
63
47
|
|
|
64
|
-
function moveAcrossDevice (src, dest, overwrite
|
|
48
|
+
async function moveAcrossDevice (src, dest, overwrite) {
|
|
65
49
|
const opts = {
|
|
66
50
|
overwrite,
|
|
67
|
-
errorOnExist: true
|
|
51
|
+
errorOnExist: true,
|
|
52
|
+
preserveTimestamps: true
|
|
68
53
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})
|
|
54
|
+
|
|
55
|
+
await copy(src, dest, opts)
|
|
56
|
+
return remove(src)
|
|
73
57
|
}
|
|
74
58
|
|
|
75
59
|
module.exports = move
|
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const u = require('universalify').
|
|
4
|
-
const fs = require('
|
|
3
|
+
const u = require('universalify').fromPromise
|
|
4
|
+
const fs = require('../fs')
|
|
5
5
|
const path = require('path')
|
|
6
6
|
const mkdir = require('../mkdirs')
|
|
7
7
|
const pathExists = require('../path-exists').pathExists
|
|
8
8
|
|
|
9
|
-
function outputFile (file, data, encoding
|
|
10
|
-
if (typeof encoding === 'function') {
|
|
11
|
-
callback = encoding
|
|
12
|
-
encoding = 'utf8'
|
|
13
|
-
}
|
|
14
|
-
|
|
9
|
+
async function outputFile (file, data, encoding = 'utf-8') {
|
|
15
10
|
const dir = path.dirname(file)
|
|
16
|
-
pathExists(dir, (err, itDoes) => {
|
|
17
|
-
if (err) return callback(err)
|
|
18
|
-
if (itDoes) return fs.writeFile(file, data, encoding, callback)
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
if (!(await pathExists(dir))) {
|
|
13
|
+
await mkdir.mkdirs(dir)
|
|
14
|
+
}
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
})
|
|
16
|
+
return fs.writeFile(file, data, encoding)
|
|
26
17
|
}
|
|
27
18
|
|
|
28
19
|
function outputFileSync (file, ...args) {
|
|
29
20
|
const dir = path.dirname(file)
|
|
30
|
-
if (fs.existsSync(dir)) {
|
|
31
|
-
|
|
21
|
+
if (!fs.existsSync(dir)) {
|
|
22
|
+
mkdir.mkdirsSync(dir)
|
|
32
23
|
}
|
|
33
|
-
|
|
24
|
+
|
|
34
25
|
fs.writeFileSync(file, ...args)
|
|
35
26
|
}
|
|
36
27
|
|