@swimlane/nodegit 1.1.2
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/.dockerignore +2 -0
- package/.github/workflows/publish.yml +126 -0
- package/.github/workflows/tests.yml +85 -0
- package/LICENSE +19 -0
- package/README.md +193 -0
- package/lib/attr.js +20 -0
- package/lib/blob.js +51 -0
- package/lib/branch.js +19 -0
- package/lib/buf.js +43 -0
- package/lib/commit.js +437 -0
- package/lib/config.js +48 -0
- package/lib/convenient_hunks.js +61 -0
- package/lib/convenient_patch.js +131 -0
- package/lib/credential.js +33 -0
- package/lib/deprecated/structs/ApplyOptions.js +3 -0
- package/lib/deprecated/structs/BlameOptions.js +6 -0
- package/lib/deprecated/structs/BlobFilterOptions.js +3 -0
- package/lib/deprecated/structs/CheckoutOptions.js +8 -0
- package/lib/deprecated/structs/CherrypickOptions.js +5 -0
- package/lib/deprecated/structs/CloneOptions.js +6 -0
- package/lib/deprecated/structs/DescribeFormatOptions.js +4 -0
- package/lib/deprecated/structs/DescribeOptions.js +6 -0
- package/lib/deprecated/structs/DiffFindOptions.js +8 -0
- package/lib/deprecated/structs/DiffOptions.js +8 -0
- package/lib/deprecated/structs/FetchOptions.js +7 -0
- package/lib/deprecated/structs/MergeFileInput.js +4 -0
- package/lib/deprecated/structs/MergeFileOptions.js +5 -0
- package/lib/deprecated/structs/MergeOptions.js +8 -0
- package/lib/deprecated/structs/ProxyOptions.js +3 -0
- package/lib/deprecated/structs/PushOptions.js +5 -0
- package/lib/deprecated/structs/RebaseOptions.js +6 -0
- package/lib/deprecated/structs/RemoteCreateOptions.js +3 -0
- package/lib/deprecated/structs/RepositoryInitOptions.js +4 -0
- package/lib/deprecated/structs/RevertOptions.js +5 -0
- package/lib/deprecated/structs/StashApplyOptions.js +4 -0
- package/lib/deprecated/structs/StatusOptions.js +4 -0
- package/lib/deprecated/structs/SubmoduleUpdateOptions.js +5 -0
- package/lib/diff.js +67 -0
- package/lib/diff_file.js +38 -0
- package/lib/diff_line.js +32 -0
- package/lib/error.js +17 -0
- package/lib/filter_registry.js +22 -0
- package/lib/graph.js +15 -0
- package/lib/index.js +103 -0
- package/lib/merge.js +41 -0
- package/lib/note.js +17 -0
- package/lib/object.js +45 -0
- package/lib/odb_object.js +9 -0
- package/lib/oid.js +23 -0
- package/lib/rebase.js +86 -0
- package/lib/reference.js +213 -0
- package/lib/remote.js +45 -0
- package/lib/repository.js +1973 -0
- package/lib/reset.js +51 -0
- package/lib/revparse.js +18 -0
- package/lib/revwalk.js +142 -0
- package/lib/signature.js +38 -0
- package/lib/stash.js +16 -0
- package/lib/status.js +16 -0
- package/lib/status_file.js +106 -0
- package/lib/submodule.js +10 -0
- package/lib/tag.js +141 -0
- package/lib/tree.js +175 -0
- package/lib/tree_entry.js +99 -0
- package/lib/utils/lookup_wrapper.js +39 -0
- package/lib/utils/shallow_clone.js +14 -0
- package/lifecycleScripts/clean.js +5 -0
- package/lifecycleScripts/install.js +32 -0
- package/lifecycleScripts/postinstall.js +83 -0
- package/lifecycleScripts/preinstall.js +47 -0
- package/lifecycleScripts/submodules/getStatus.js +50 -0
- package/lifecycleScripts/submodules/index.js +84 -0
- package/package.json +83 -0
- package/prebuilds/darwin-arm64/@swimlane+nodegit.glibc.node +0 -0
- package/prebuilds/darwin-x64/@swimlane+nodegit.glibc.node +0 -0
- package/prebuilds/linux-arm64/@swimlane+nodegit.glibc.node +0 -0
- package/prebuilds/linux-x64/@swimlane+nodegit.glibc.node +0 -0
- package/prebuilds/linux-x64/@swimlane+nodegit.musl.node +0 -0
- package/scripts/Dockerfile.alpine +10 -0
- package/scripts/Dockerfile.debian +15 -0
- package/utils/acquireOpenSSL.js +436 -0
- package/utils/build-openssl.bat +13 -0
- package/utils/buildFlags.js +19 -0
- package/utils/configureLibssh2.js +54 -0
- package/utils/defaultCxxStandard.js +18 -0
- package/utils/execPromise.js +24 -0
- package/utils/getElectronOpenSSLRoot.js +10 -0
- package/utils/gitExecutableLocation.js +23 -0
- package/utils/isBuildingForElectron.js +30 -0
- package/utils/retry.js +51 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
|
|
3
|
+
if (process.argv.length < 3) {
|
|
4
|
+
process.exit(1);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const [, , moduleRootDir] = process.argv;
|
|
8
|
+
|
|
9
|
+
const openSSLRoot = process.env.npm_config_openssl_dir || path.join(moduleRootDir, 'vendor', 'openssl');
|
|
10
|
+
process.stdout.write(openSSLRoot);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var cp = require("child_process");
|
|
2
|
+
|
|
3
|
+
module.exports = function gitExecutableLocation() {
|
|
4
|
+
return new Promise(function(resolve, reject) {
|
|
5
|
+
var cmd;
|
|
6
|
+
|
|
7
|
+
if (process.platform === "win32") {
|
|
8
|
+
cmd = "where git";
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
cmd = "which git";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
cp.exec(cmd, function(err, stdout, stderr) {
|
|
15
|
+
if (err) {
|
|
16
|
+
reject(err, stderr);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
resolve(stdout);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const fs = require("fs")
|
|
2
|
+
const JSON5 = require("json5");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
if (process.argv.length < 3) {
|
|
6
|
+
process.exit(1);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const last = arr => arr[arr.length - 1];
|
|
10
|
+
const [, , nodeRootDir] = process.argv;
|
|
11
|
+
|
|
12
|
+
let isElectron = last(nodeRootDir.split(path.sep)).startsWith("iojs");
|
|
13
|
+
|
|
14
|
+
if (!isElectron) {
|
|
15
|
+
try {
|
|
16
|
+
// Not ideal, would love it if there were a full featured gyp package to do this operation instead.
|
|
17
|
+
const { variables: { built_with_electron } } = JSON5.parse(
|
|
18
|
+
fs.readFileSync(
|
|
19
|
+
path.resolve(nodeRootDir, "include", "node", "config.gypi"),
|
|
20
|
+
"utf8"
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (built_with_electron) {
|
|
25
|
+
isElectron = true;
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
process.stdout.write(isElectron ? "1" : "0");
|
package/utils/retry.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const { spawn } = require('child_process');
|
|
2
|
+
|
|
3
|
+
const [, , cmd, ...args] = process.argv;
|
|
4
|
+
if (!cmd) {
|
|
5
|
+
process.exit(-1);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const once = (fn) => {
|
|
9
|
+
let runOnce = false;
|
|
10
|
+
return (...args) => {
|
|
11
|
+
if (runOnce) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
runOnce = true;
|
|
16
|
+
fn(...args);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const retry = (numRetries = 3) => {
|
|
21
|
+
const child = spawn(cmd, args, {
|
|
22
|
+
shell: process.platform === 'win32',
|
|
23
|
+
stdio: [0, 'pipe', 'pipe']
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
child.setMaxListeners(0);
|
|
27
|
+
|
|
28
|
+
child.stdout.setEncoding('utf8');
|
|
29
|
+
child.stderr.setEncoding('utf8');
|
|
30
|
+
|
|
31
|
+
child.stdout.pipe(process.stdout);
|
|
32
|
+
child.stderr.pipe(process.stderr);
|
|
33
|
+
|
|
34
|
+
const cleanupAndExit = once((error, status) => {
|
|
35
|
+
child.kill();
|
|
36
|
+
if (numRetries > 0 && (error || status !== 0)) {
|
|
37
|
+
retry(numRetries - 1);
|
|
38
|
+
} else if (error) {
|
|
39
|
+
console.log(error);
|
|
40
|
+
process.exit(-1);
|
|
41
|
+
} else {
|
|
42
|
+
process.exit(status);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const onClose = status => cleanupAndExit(null, status);
|
|
46
|
+
|
|
47
|
+
child.on('close', onClose);
|
|
48
|
+
child.on('error', cleanupAndExit);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
retry();
|