dprint 0.47.6 → 0.48.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/install_api.js +14 -2
- package/package.json +10 -10
package/install_api.js
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = {
|
|
|
36
36
|
// in order to make things faster the next time we run and to allow the
|
|
37
37
|
// dprint vscode extension to easily pick this up, copy the executable
|
|
38
38
|
// into the dprint package folder
|
|
39
|
-
|
|
39
|
+
hardLinkOrCopy(sourceExecutablePath, targetExecutablePath);
|
|
40
40
|
if (os.platform() !== "win32") {
|
|
41
41
|
// chomd +x
|
|
42
42
|
chmodX(targetExecutablePath);
|
|
@@ -144,7 +144,19 @@ function getLinuxFamily() {
|
|
|
144
144
|
* @param sourcePath {string}
|
|
145
145
|
* @param destinationPath {string}
|
|
146
146
|
*/
|
|
147
|
-
function
|
|
147
|
+
function hardLinkOrCopy(sourcePath, destinationPath) {
|
|
148
|
+
try {
|
|
149
|
+
fs.linkSync(sourcePath, destinationPath);
|
|
150
|
+
} catch {
|
|
151
|
+
atomicCopyFile(sourcePath, destinationPath);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @param sourcePath {string}
|
|
157
|
+
* @param destinationPath {string}
|
|
158
|
+
*/
|
|
159
|
+
function atomicCopyFile(sourcePath, destinationPath) {
|
|
148
160
|
const crypto = require("crypto");
|
|
149
161
|
const rand = crypto.randomBytes(4).toString("hex");
|
|
150
162
|
const tempFilePath = destinationPath + "." + rand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "Pluggable and configurable code formatting platform written in Rust.",
|
|
5
5
|
"bin": "bin.js",
|
|
6
6
|
"repository": {
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"postinstall": "node ./install.js"
|
|
23
23
|
},
|
|
24
24
|
"optionalDependencies": {
|
|
25
|
-
"@dprint/win32-x64": "0.
|
|
26
|
-
"@dprint/win32-arm64": "0.
|
|
27
|
-
"@dprint/darwin-x64": "0.
|
|
28
|
-
"@dprint/darwin-arm64": "0.
|
|
29
|
-
"@dprint/linux-x64-glibc": "0.
|
|
30
|
-
"@dprint/linux-x64-musl": "0.
|
|
31
|
-
"@dprint/linux-arm64-glibc": "0.
|
|
32
|
-
"@dprint/linux-arm64-musl": "0.
|
|
33
|
-
"@dprint/linux-riscv64-glibc": "0.
|
|
25
|
+
"@dprint/win32-x64": "0.48.0",
|
|
26
|
+
"@dprint/win32-arm64": "0.48.0",
|
|
27
|
+
"@dprint/darwin-x64": "0.48.0",
|
|
28
|
+
"@dprint/darwin-arm64": "0.48.0",
|
|
29
|
+
"@dprint/linux-x64-glibc": "0.48.0",
|
|
30
|
+
"@dprint/linux-x64-musl": "0.48.0",
|
|
31
|
+
"@dprint/linux-arm64-glibc": "0.48.0",
|
|
32
|
+
"@dprint/linux-arm64-musl": "0.48.0",
|
|
33
|
+
"@dprint/linux-riscv64-glibc": "0.48.0"
|
|
34
34
|
}
|
|
35
35
|
}
|