mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-05-17 14:44:46 +00:00
Migrate to Biome for linting and formatting (#107)
This commit is contained in:
parent
023eb7875f
commit
c11f8674f8
17 changed files with 331 additions and 5772 deletions
22
dist/update-known-checksums/index.js
generated
vendored
22
dist/update-known-checksums/index.js
generated
vendored
|
@ -32708,24 +32708,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.updateChecksums = updateChecksums;
|
||||
const fs_1 = __nccwpck_require__(7147);
|
||||
const node_fs_1 = __nccwpck_require__(7561);
|
||||
const tc = __importStar(__nccwpck_require__(7784));
|
||||
function updateChecksums(filePath, downloadUrls) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield fs_1.promises.rm(filePath);
|
||||
yield fs_1.promises.appendFile(filePath, "// AUTOGENERATED_DO_NOT_EDIT\nexport const KNOWN_CHECKSUMS: {[key: string]: string} = {\n");
|
||||
yield node_fs_1.promises.rm(filePath);
|
||||
yield node_fs_1.promises.appendFile(filePath, "// AUTOGENERATED_DO_NOT_EDIT\nexport const KNOWN_CHECKSUMS: {[key: string]: string} = {\n");
|
||||
let firstLine = true;
|
||||
for (const downloadUrl of downloadUrls) {
|
||||
const content = yield downloadAssetContent(downloadUrl);
|
||||
const checksum = content.split(" ")[0].trim();
|
||||
const key = getKey(downloadUrl);
|
||||
if (!firstLine) {
|
||||
yield fs_1.promises.appendFile(filePath, ",\n");
|
||||
yield node_fs_1.promises.appendFile(filePath, ",\n");
|
||||
}
|
||||
yield fs_1.promises.appendFile(filePath, ` '${key}':\n '${checksum}'`);
|
||||
yield node_fs_1.promises.appendFile(filePath, ` '${key}':\n '${checksum}'`);
|
||||
firstLine = false;
|
||||
}
|
||||
yield fs_1.promises.appendFile(filePath, "}\n");
|
||||
yield node_fs_1.promises.appendFile(filePath, "}\n");
|
||||
});
|
||||
}
|
||||
function getKey(downloadUrl) {
|
||||
|
@ -32739,7 +32739,7 @@ function getKey(downloadUrl) {
|
|||
function downloadAssetContent(downloadUrl) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const downloadPath = yield tc.downloadTool(downloadUrl);
|
||||
const content = yield fs_1.promises.readFile(downloadPath, "utf8");
|
||||
const content = yield node_fs_1.promises.readFile(downloadPath, "utf8");
|
||||
return content;
|
||||
});
|
||||
}
|
||||
|
@ -32940,6 +32940,14 @@ module.exports = require("node:events");
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7561:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("node:fs");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4492:
|
||||
/***/ ((module) => {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue