bibsync 0.3.3__tar.gz → 0.3.5__tar.gz
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.
- {bibsync-0.3.3 → bibsync-0.3.5}/.pre-commit-config.yaml +3 -3
- {bibsync-0.3.3 → bibsync-0.3.5}/CITATION.cff +2 -2
- {bibsync-0.3.3 → bibsync-0.3.5}/Cargo.lock +23 -24
- {bibsync-0.3.3 → bibsync-0.3.5}/Cargo.toml +1 -1
- {bibsync-0.3.3 → bibsync-0.3.5}/PKG-INFO +6 -6
- {bibsync-0.3.3 → bibsync-0.3.5}/README.md +5 -5
- bibsync-0.3.5/scripts/pre-commit-bibsync +105 -0
- bibsync-0.3.3/scripts/pre-commit-bibsync +0 -68
- {bibsync-0.3.3 → bibsync-0.3.5}/.gitignore +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/.markdownlint.yaml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/.pre-commit-hooks.yaml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/.prettierrc +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/.typos.toml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/CODE_OF_CONDUCT.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/CONTRIBUTING.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/LICENSE +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/SECURITY.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/SUPPORT.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/benches/greeting.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/cliff.toml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/deny.toml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/api/index.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/contributing.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/index.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/security.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/user-guide/examples.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/user-guide/installation.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/user-guide/pre-commit.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/user-guide/providers.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/docs/user-guide/usage.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/examples/README.md +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/examples/greet.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/examples/inspire-main.bib +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/examples/inspire-main.tex +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/examples/main.bib +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/examples/main.tex +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/pyproject.toml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/python/bibsync/__init__.py +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/python/bibsync/__init__.pyi +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/python/bibsync/__main__.py +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/python/bibsync/py.typed +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/renovate.json +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/rust-toolchain.toml +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/setup_repo.sh +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/src/cli.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/src/lib.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/src/main.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/src/python.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/tests/cli.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/tests/examples.rs +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/tests/python/test_bindings.py +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/uv.lock +0 -0
- {bibsync-0.3.3 → bibsync-0.3.5}/zensical.toml +0 -0
|
@@ -31,14 +31,14 @@ repos:
|
|
|
31
31
|
pass_filenames: false
|
|
32
32
|
|
|
33
33
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
34
|
-
rev: v0.15.
|
|
34
|
+
rev: v0.15.16
|
|
35
35
|
hooks:
|
|
36
36
|
- id: ruff
|
|
37
37
|
args: [--fix, --config=pyproject.toml]
|
|
38
38
|
- id: ruff-format
|
|
39
39
|
|
|
40
40
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
41
|
-
rev: 0.11.
|
|
41
|
+
rev: 0.11.19
|
|
42
42
|
hooks:
|
|
43
43
|
- id: uv-lock
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@ repos:
|
|
|
53
53
|
- id: taplo-format
|
|
54
54
|
|
|
55
55
|
- repo: https://github.com/crate-ci/typos
|
|
56
|
-
rev: v1.47.
|
|
56
|
+
rev: v1.47.2
|
|
57
57
|
hooks:
|
|
58
58
|
- id: typos
|
|
59
59
|
args: []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
cff-version: 1.2.0
|
|
2
2
|
title: "bibsync: A Rust package to automatically resolve, synchronize, and validate LaTeX citations across BibTeX databases"
|
|
3
|
-
version: "0.3.
|
|
4
|
-
date-released: "2026-06-
|
|
3
|
+
version: "0.3.5"
|
|
4
|
+
date-released: "2026-06-09"
|
|
5
5
|
license: "BSD-3-Clause"
|
|
6
6
|
type: software
|
|
7
7
|
authors:
|
|
@@ -124,7 +124,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
|
|
124
124
|
|
|
125
125
|
[[package]]
|
|
126
126
|
name = "bibsync"
|
|
127
|
-
version = "0.3.
|
|
127
|
+
version = "0.3.5"
|
|
128
128
|
dependencies = [
|
|
129
129
|
"assert_cmd",
|
|
130
130
|
"clap",
|
|
@@ -141,9 +141,9 @@ dependencies = [
|
|
|
141
141
|
|
|
142
142
|
[[package]]
|
|
143
143
|
name = "bitflags"
|
|
144
|
-
version = "2.
|
|
144
|
+
version = "2.13.0"
|
|
145
145
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
146
|
-
checksum = "
|
|
146
|
+
checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
|
147
147
|
|
|
148
148
|
[[package]]
|
|
149
149
|
name = "bstr"
|
|
@@ -498,9 +498,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
|
498
498
|
|
|
499
499
|
[[package]]
|
|
500
500
|
name = "http"
|
|
501
|
-
version = "1.4.
|
|
501
|
+
version = "1.4.2"
|
|
502
502
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
503
|
-
checksum = "
|
|
503
|
+
checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425"
|
|
504
504
|
dependencies = [
|
|
505
505
|
"bytes",
|
|
506
506
|
"itoa",
|
|
@@ -792,13 +792,12 @@ dependencies = [
|
|
|
792
792
|
|
|
793
793
|
[[package]]
|
|
794
794
|
name = "js-sys"
|
|
795
|
-
version = "0.3.
|
|
795
|
+
version = "0.3.100"
|
|
796
796
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
797
|
-
checksum = "
|
|
797
|
+
checksum = "f2025f20d7a4fa7785846e7b63d10a76d3f1cee98ee5cb79ea59703f95e42162"
|
|
798
798
|
dependencies = [
|
|
799
799
|
"cfg-if",
|
|
800
800
|
"futures-util",
|
|
801
|
-
"once_cell",
|
|
802
801
|
"wasm-bindgen",
|
|
803
802
|
]
|
|
804
803
|
|
|
@@ -828,9 +827,9 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
|
|
|
828
827
|
|
|
829
828
|
[[package]]
|
|
830
829
|
name = "log"
|
|
831
|
-
version = "0.4.
|
|
830
|
+
version = "0.4.32"
|
|
832
831
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
833
|
-
checksum = "
|
|
832
|
+
checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a"
|
|
834
833
|
|
|
835
834
|
[[package]]
|
|
836
835
|
name = "lru-slab"
|
|
@@ -1806,9 +1805,9 @@ dependencies = [
|
|
|
1806
1805
|
|
|
1807
1806
|
[[package]]
|
|
1808
1807
|
name = "wasm-bindgen"
|
|
1809
|
-
version = "0.2.
|
|
1808
|
+
version = "0.2.123"
|
|
1810
1809
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1811
|
-
checksum = "
|
|
1810
|
+
checksum = "a254a4b10c19a76f09a27640e7ffbf9bc30bf67e16a3bf28aaefa4920fe81563"
|
|
1812
1811
|
dependencies = [
|
|
1813
1812
|
"cfg-if",
|
|
1814
1813
|
"once_cell",
|
|
@@ -1819,9 +1818,9 @@ dependencies = [
|
|
|
1819
1818
|
|
|
1820
1819
|
[[package]]
|
|
1821
1820
|
name = "wasm-bindgen-futures"
|
|
1822
|
-
version = "0.4.
|
|
1821
|
+
version = "0.4.73"
|
|
1823
1822
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1824
|
-
checksum = "
|
|
1823
|
+
checksum = "54568702fabf5d4849ce2b90fadfa64168a097eaf4b351ce9df8b687a0086aaf"
|
|
1825
1824
|
dependencies = [
|
|
1826
1825
|
"js-sys",
|
|
1827
1826
|
"wasm-bindgen",
|
|
@@ -1829,9 +1828,9 @@ dependencies = [
|
|
|
1829
1828
|
|
|
1830
1829
|
[[package]]
|
|
1831
1830
|
name = "wasm-bindgen-macro"
|
|
1832
|
-
version = "0.2.
|
|
1831
|
+
version = "0.2.123"
|
|
1833
1832
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1834
|
-
checksum = "
|
|
1833
|
+
checksum = "24a40fc75b0ec6f3746ceb10d36f53a93dcd68a93b11b6445983945d79eba0dc"
|
|
1835
1834
|
dependencies = [
|
|
1836
1835
|
"quote",
|
|
1837
1836
|
"wasm-bindgen-macro-support",
|
|
@@ -1839,9 +1838,9 @@ dependencies = [
|
|
|
1839
1838
|
|
|
1840
1839
|
[[package]]
|
|
1841
1840
|
name = "wasm-bindgen-macro-support"
|
|
1842
|
-
version = "0.2.
|
|
1841
|
+
version = "0.2.123"
|
|
1843
1842
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1844
|
-
checksum = "
|
|
1843
|
+
checksum = "908f34bd9b9ce3d4caf07b72dfab63d61504d156856c6bd3cd87fa350cf3985b"
|
|
1845
1844
|
dependencies = [
|
|
1846
1845
|
"bumpalo",
|
|
1847
1846
|
"proc-macro2",
|
|
@@ -1852,9 +1851,9 @@ dependencies = [
|
|
|
1852
1851
|
|
|
1853
1852
|
[[package]]
|
|
1854
1853
|
name = "wasm-bindgen-shared"
|
|
1855
|
-
version = "0.2.
|
|
1854
|
+
version = "0.2.123"
|
|
1856
1855
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1857
|
-
checksum = "
|
|
1856
|
+
checksum = "7acbf7616c27b194bbb550bf77ed0c2c3e5b7fd1260a93082b95fb7f47959b92"
|
|
1858
1857
|
dependencies = [
|
|
1859
1858
|
"unicode-ident",
|
|
1860
1859
|
]
|
|
@@ -1895,9 +1894,9 @@ dependencies = [
|
|
|
1895
1894
|
|
|
1896
1895
|
[[package]]
|
|
1897
1896
|
name = "web-sys"
|
|
1898
|
-
version = "0.3.
|
|
1897
|
+
version = "0.3.100"
|
|
1899
1898
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1900
|
-
checksum = "
|
|
1899
|
+
checksum = "6e0871acf327f283dc6da28a1696cdc64fb355ba9f935d052021fa77f35cce69"
|
|
1901
1900
|
dependencies = [
|
|
1902
1901
|
"js-sys",
|
|
1903
1902
|
"wasm-bindgen",
|
|
@@ -2195,9 +2194,9 @@ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
|
|
|
2195
2194
|
|
|
2196
2195
|
[[package]]
|
|
2197
2196
|
name = "yoke"
|
|
2198
|
-
version = "0.8.
|
|
2197
|
+
version = "0.8.3"
|
|
2199
2198
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2200
|
-
checksum = "
|
|
2199
|
+
checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5"
|
|
2201
2200
|
dependencies = [
|
|
2202
2201
|
"stable_deref_trait",
|
|
2203
2202
|
"yoke-derive",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bibsync
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Environment :: Console
|
|
6
6
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -117,7 +117,7 @@ For convenience, you can also use:
|
|
|
117
117
|
@software{wong2026bibsync,
|
|
118
118
|
author = {Wong, Isaac C. F.},
|
|
119
119
|
title = {bibsync: A Rust package to automatically resolve, synchronize, and validate LaTeX citations across BibTeX databases},
|
|
120
|
-
version = {v0.3.
|
|
120
|
+
version = {v0.3.5},
|
|
121
121
|
year = {2026},
|
|
122
122
|
month = jun,
|
|
123
123
|
doi = {10.5281/zenodo.20422622},
|
|
@@ -269,7 +269,7 @@ Use the pre-built binary hook for faster installs:
|
|
|
269
269
|
```yaml
|
|
270
270
|
repos:
|
|
271
271
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
272
|
-
rev: v0.3.
|
|
272
|
+
rev: v0.3.5
|
|
273
273
|
hooks:
|
|
274
274
|
- id: bibsync-bin
|
|
275
275
|
args: [--cache, --provider, inspire, --output, references.bib]
|
|
@@ -284,7 +284,7 @@ installation:
|
|
|
284
284
|
```yaml
|
|
285
285
|
repos:
|
|
286
286
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
287
|
-
rev: v0.3.
|
|
287
|
+
rev: v0.3.5
|
|
288
288
|
hooks:
|
|
289
289
|
- id: bibsync
|
|
290
290
|
args: [--provider, inspire, --output, references.bib]
|
|
@@ -296,7 +296,7 @@ writing changes. To let the hook update files, add `--fix` to the hook args:
|
|
|
296
296
|
```yaml
|
|
297
297
|
repos:
|
|
298
298
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
299
|
-
rev: v0.3.
|
|
299
|
+
rev: v0.3.5
|
|
300
300
|
hooks:
|
|
301
301
|
- id: bibsync-bin
|
|
302
302
|
args: [--fix, --cache, --provider, inspire, --output, references.bib]
|
|
@@ -307,7 +307,7 @@ To skip manually curated entries, add `--ignore-file`:
|
|
|
307
307
|
```yaml
|
|
308
308
|
repos:
|
|
309
309
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
310
|
-
rev: v0.3.
|
|
310
|
+
rev: v0.3.5
|
|
311
311
|
hooks:
|
|
312
312
|
- id: bibsync-bin
|
|
313
313
|
args:
|
|
@@ -90,7 +90,7 @@ For convenience, you can also use:
|
|
|
90
90
|
@software{wong2026bibsync,
|
|
91
91
|
author = {Wong, Isaac C. F.},
|
|
92
92
|
title = {bibsync: A Rust package to automatically resolve, synchronize, and validate LaTeX citations across BibTeX databases},
|
|
93
|
-
version = {v0.3.
|
|
93
|
+
version = {v0.3.5},
|
|
94
94
|
year = {2026},
|
|
95
95
|
month = jun,
|
|
96
96
|
doi = {10.5281/zenodo.20422622},
|
|
@@ -242,7 +242,7 @@ Use the pre-built binary hook for faster installs:
|
|
|
242
242
|
```yaml
|
|
243
243
|
repos:
|
|
244
244
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
245
|
-
rev: v0.3.
|
|
245
|
+
rev: v0.3.5
|
|
246
246
|
hooks:
|
|
247
247
|
- id: bibsync-bin
|
|
248
248
|
args: [--cache, --provider, inspire, --output, references.bib]
|
|
@@ -257,7 +257,7 @@ installation:
|
|
|
257
257
|
```yaml
|
|
258
258
|
repos:
|
|
259
259
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
260
|
-
rev: v0.3.
|
|
260
|
+
rev: v0.3.5
|
|
261
261
|
hooks:
|
|
262
262
|
- id: bibsync
|
|
263
263
|
args: [--provider, inspire, --output, references.bib]
|
|
@@ -269,7 +269,7 @@ writing changes. To let the hook update files, add `--fix` to the hook args:
|
|
|
269
269
|
```yaml
|
|
270
270
|
repos:
|
|
271
271
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
272
|
-
rev: v0.3.
|
|
272
|
+
rev: v0.3.5
|
|
273
273
|
hooks:
|
|
274
274
|
- id: bibsync-bin
|
|
275
275
|
args: [--fix, --cache, --provider, inspire, --output, references.bib]
|
|
@@ -280,7 +280,7 @@ To skip manually curated entries, add `--ignore-file`:
|
|
|
280
280
|
```yaml
|
|
281
281
|
repos:
|
|
282
282
|
- repo: https://github.com/isaac-cf-wong/bibsync
|
|
283
|
-
rev: v0.3.
|
|
283
|
+
rev: v0.3.5
|
|
284
284
|
hooks:
|
|
285
285
|
- id: bibsync-bin
|
|
286
286
|
args:
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
version="${BIBSYNC_VERSION:-}"
|
|
6
|
+
|
|
7
|
+
if [ -z "$version" ]; then
|
|
8
|
+
version="$(git -C "$repo_root" describe --tags --exact-match HEAD 2>/dev/null || true)"
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
if [ -z "$version" ]; then
|
|
12
|
+
version="v$(sed -n 's/^version = "\(.*\)"/\1/p' "$repo_root/Cargo.toml" | head -n 1)"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
case "$(uname -s)" in
|
|
16
|
+
Linux) os="linux" ;;
|
|
17
|
+
Darwin) os="macos" ;;
|
|
18
|
+
MINGW*|MSYS*|CYGWIN*) os="windows" ;;
|
|
19
|
+
*)
|
|
20
|
+
echo "Unsupported OS: $(uname -s)" >&2
|
|
21
|
+
exit 2
|
|
22
|
+
;;
|
|
23
|
+
esac
|
|
24
|
+
|
|
25
|
+
case "$(uname -m)" in
|
|
26
|
+
x86_64|amd64) arch="x86_64" ;;
|
|
27
|
+
arm64|aarch64) arch="aarch64" ;;
|
|
28
|
+
*)
|
|
29
|
+
echo "Unsupported architecture: $(uname -m)" >&2
|
|
30
|
+
exit 2
|
|
31
|
+
;;
|
|
32
|
+
esac
|
|
33
|
+
|
|
34
|
+
cache_root="${PRE_COMMIT_HOME:-${XDG_CACHE_HOME:-$HOME/.cache/pre-commit}}/bibsync"
|
|
35
|
+
install_dir="$cache_root/$version-$os-$arch"
|
|
36
|
+
binary="$install_dir/bibsync"
|
|
37
|
+
install_marker="$install_dir/.installed"
|
|
38
|
+
archive_ext="tar.gz"
|
|
39
|
+
|
|
40
|
+
if [ "$os" = "windows" ]; then
|
|
41
|
+
binary="$install_dir/bibsync.exe"
|
|
42
|
+
archive_ext="zip"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
if [ ! -x "$binary" ] || [ ! -f "$install_marker" ]; then
|
|
46
|
+
mkdir -p "$cache_root"
|
|
47
|
+
lock_dir="$cache_root/$version-$os-$arch.lock"
|
|
48
|
+
tmp_dir=""
|
|
49
|
+
cleanup_install() {
|
|
50
|
+
if [ -n "$tmp_dir" ]; then
|
|
51
|
+
rm -rf "$tmp_dir"
|
|
52
|
+
fi
|
|
53
|
+
rmdir "$lock_dir" 2>/dev/null || true
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
lock_waits=0
|
|
57
|
+
while ! mkdir "$lock_dir" 2>/dev/null; do
|
|
58
|
+
lock_waits=$((lock_waits + 1))
|
|
59
|
+
if [ "$lock_waits" -ge 300 ]; then
|
|
60
|
+
echo "Timed out waiting for bibsync install lock: $lock_dir" >&2
|
|
61
|
+
exit 2
|
|
62
|
+
fi
|
|
63
|
+
sleep 1
|
|
64
|
+
done
|
|
65
|
+
trap cleanup_install EXIT
|
|
66
|
+
|
|
67
|
+
if [ -x "$binary" ]; then
|
|
68
|
+
touch "$install_marker"
|
|
69
|
+
else
|
|
70
|
+
tmp_dir="$(mktemp -d "$cache_root/.install.XXXXXX")"
|
|
71
|
+
staging_dir="$tmp_dir/extract"
|
|
72
|
+
mkdir -p "$staging_dir"
|
|
73
|
+
|
|
74
|
+
archive="bibsync-$version-$os-$arch.$archive_ext"
|
|
75
|
+
url="https://github.com/isaac-cf-wong/bibsync/releases/download/$version/$archive"
|
|
76
|
+
tmp="$tmp_dir/$archive"
|
|
77
|
+
|
|
78
|
+
echo "Downloading $url" >&2
|
|
79
|
+
if command -v curl >/dev/null 2>&1; then
|
|
80
|
+
curl --fail --location --silent --show-error "$url" --output "$tmp"
|
|
81
|
+
elif command -v wget >/dev/null 2>&1; then
|
|
82
|
+
wget -q "$url" -O "$tmp"
|
|
83
|
+
else
|
|
84
|
+
echo "curl or wget is required to download the bibsync binary" >&2
|
|
85
|
+
exit 2
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
if [ "$archive_ext" = "zip" ]; then
|
|
89
|
+
unzip -q -o "$tmp" -d "$staging_dir"
|
|
90
|
+
else
|
|
91
|
+
tar -xzf "$tmp" -C "$staging_dir"
|
|
92
|
+
fi
|
|
93
|
+
staging_binary="$staging_dir/$(basename "$binary")"
|
|
94
|
+
chmod +x "$staging_binary"
|
|
95
|
+
mkdir -p "$install_dir"
|
|
96
|
+
mv "$staging_binary" "$binary"
|
|
97
|
+
touch "$install_marker"
|
|
98
|
+
rm -rf "$tmp_dir"
|
|
99
|
+
tmp_dir=""
|
|
100
|
+
fi
|
|
101
|
+
cleanup_install
|
|
102
|
+
trap - EXIT
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
exec "$binary" "$@"
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
-
version="${BIBSYNC_VERSION:-}"
|
|
6
|
-
|
|
7
|
-
if [ -z "$version" ]; then
|
|
8
|
-
version="$(git -C "$repo_root" describe --tags --exact-match HEAD 2>/dev/null || true)"
|
|
9
|
-
fi
|
|
10
|
-
|
|
11
|
-
if [ -z "$version" ]; then
|
|
12
|
-
version="v$(sed -n 's/^version = "\(.*\)"/\1/p' "$repo_root/Cargo.toml" | head -n 1)"
|
|
13
|
-
fi
|
|
14
|
-
|
|
15
|
-
case "$(uname -s)" in
|
|
16
|
-
Linux) os="linux" ;;
|
|
17
|
-
Darwin) os="macos" ;;
|
|
18
|
-
MINGW*|MSYS*|CYGWIN*) os="windows" ;;
|
|
19
|
-
*)
|
|
20
|
-
echo "Unsupported OS: $(uname -s)" >&2
|
|
21
|
-
exit 2
|
|
22
|
-
;;
|
|
23
|
-
esac
|
|
24
|
-
|
|
25
|
-
case "$(uname -m)" in
|
|
26
|
-
x86_64|amd64) arch="x86_64" ;;
|
|
27
|
-
arm64|aarch64) arch="aarch64" ;;
|
|
28
|
-
*)
|
|
29
|
-
echo "Unsupported architecture: $(uname -m)" >&2
|
|
30
|
-
exit 2
|
|
31
|
-
;;
|
|
32
|
-
esac
|
|
33
|
-
|
|
34
|
-
cache_root="${PRE_COMMIT_HOME:-${XDG_CACHE_HOME:-$HOME/.cache/pre-commit}}/bibsync"
|
|
35
|
-
install_dir="$cache_root/$version-$os-$arch"
|
|
36
|
-
binary="$install_dir/bibsync"
|
|
37
|
-
archive_ext="tar.gz"
|
|
38
|
-
|
|
39
|
-
if [ "$os" = "windows" ]; then
|
|
40
|
-
binary="$install_dir/bibsync.exe"
|
|
41
|
-
archive_ext="zip"
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
if [ ! -x "$binary" ]; then
|
|
45
|
-
mkdir -p "$install_dir"
|
|
46
|
-
archive="bibsync-$version-$os-$arch.$archive_ext"
|
|
47
|
-
url="https://github.com/isaac-cf-wong/bibsync/releases/download/$version/$archive"
|
|
48
|
-
tmp="$install_dir/$archive"
|
|
49
|
-
|
|
50
|
-
echo "Downloading $url" >&2
|
|
51
|
-
if command -v curl >/dev/null 2>&1; then
|
|
52
|
-
curl --fail --location --silent --show-error "$url" --output "$tmp"
|
|
53
|
-
elif command -v wget >/dev/null 2>&1; then
|
|
54
|
-
wget -q "$url" -O "$tmp"
|
|
55
|
-
else
|
|
56
|
-
echo "curl or wget is required to download the bibsync binary" >&2
|
|
57
|
-
exit 2
|
|
58
|
-
fi
|
|
59
|
-
|
|
60
|
-
if [ "$archive_ext" = "zip" ]; then
|
|
61
|
-
unzip -q -o "$tmp" -d "$install_dir"
|
|
62
|
-
else
|
|
63
|
-
tar -xzf "$tmp" -C "$install_dir"
|
|
64
|
-
fi
|
|
65
|
-
chmod +x "$binary"
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
exec "$binary" "$@"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|