Skip to content

Commit c8c7b20

Browse files
Remove build reliance on .git (#481)
fixes #477 **Description :** This pull request addresses the issue where the build process was relying on Git for version information. The problem arose when the build process did not have Git available. **Changes Made :** -In package.json, updated the `version` field to the latest released GitHub version -In build.ts, modified the code to use the version specified in package.json.
1 parent d2a7c7c commit c8c7b20

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as child_process from 'child_process';
1+
import * as packageJson from './package.json';
22
import * as path from 'path';
33
import { promises as fs } from 'fs';
44

@@ -62,7 +62,7 @@ const allowedLang = (code: string): boolean => {
6262
const Plugin = {
6363
name: 'apertium-html-tools',
6464
setup: async ({ initialOptions, onEnd }: esbuild.PluginBuild) => {
65-
const version = child_process.execSync('git describe --tags --always').toString().trim();
65+
const version = `v${(packageJson as { version: string }).version}`;
6666

6767
let defaultStrings: unknown;
6868

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apertium-html-tools",
3-
"version": "5.0.0",
3+
"version": "5.1.8",
44
"author": "Sushain Cherivirala <sushain@skc.name>",
55
"license": "GPL-3.0-or-later",
66
"scripts": {

0 commit comments

Comments
 (0)