-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate checksum generation for standalone CLI (#14081)
- Loading branch information
1 parent
9824cb6
commit 28bd90e
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { createHash } from 'node:crypto' | ||
import { readFile, writeFile } from 'node:fs/promises' | ||
import * as path from 'node:path' | ||
|
||
const files = [ | ||
'./tailwindcss-linux-arm64', | ||
'./tailwindcss-linux-armv7', | ||
'./tailwindcss-linux-x64', | ||
'./tailwindcss-macos-arm64', | ||
'./tailwindcss-macos-x64', | ||
'./tailwindcss-windows-arm64.exe', | ||
'./tailwindcss-windows-x64.exe', | ||
] | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname) | ||
|
||
const lines = await Promise.all( | ||
files.map(async (file) => { | ||
let sum = createHash('sha256') | ||
.update(await readFile(path.resolve(__dirname, '../dist', file))) | ||
.digest('hex') | ||
|
||
return `${sum} ${file}` | ||
}) | ||
) | ||
|
||
await writeFile(path.resolve(__dirname, '../dist', 'sha256sums.txt'), lines.join('\n') + '\n') |