Skip to content

Commit f17f9c8

Browse files
committed
add compare file script
1 parent 6df80d0 commit f17f9c8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "matrix-web-i18n",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "Internationalisation utils for Matrix web projects",
55
"keywords": [
66
"i18n"
77
],
88
"license": "Apache-2.0",
99
"bin": {
10-
"gen-18n": "scripts/gen-i18n.js",
11-
"prune-18n": "scripts/prune-i18n.js"
10+
"gen-i18n": "scripts/gen-i18n.js",
11+
"prune-i18n": "scripts/prune-i18n.js",
12+
"compare-i18n-files": "scripts/compare-file.js"
1213
},
1314
"repository": {
1415
"type": "git",

scripts/compare-file.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const fs = require("fs");
2+
3+
if (process.argv.length < 4) throw new Error("Missing source and target file arguments");
4+
5+
const sourceFile = fs.readFileSync(process.argv[2], 'utf8');
6+
const targetFile = fs.readFileSync(process.argv[3], 'utf8');
7+
8+
if (sourceFile !== targetFile) {
9+
throw new Error("Files do not match");
10+
}

0 commit comments

Comments
 (0)