Download reselect/scripts/writeGitVersion.mjs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/reselect/scripts/writeGitVersion.mjs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/reselect/scripts/writeGitVersion.mjs
-
curl -L -o writeGitVersion.mjs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/reselect/scripts/writeGitVersion.mjs
427 Bytes
| import path from 'path' | |
| import fs from 'fs' | |
| import { fileURLToPath } from 'node:url' | |
| const __filename = fileURLToPath(import.meta.url) | |
| const __dirname = path.dirname(__filename) | |
| const gitRev = process.argv[2] | |
| const packagePath = path.join(__dirname, '../package.json') | |
| const pkg = JSON.parse(fs.readFileSync(packagePath)) | |
| pkg.version = `${pkg.version}-${gitRev}` | |
| fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2)) | |