Skip to content

Commit fcff425

Browse files
committed
Add second json file in frontend to script
1 parent 7ef3e71 commit fcff425

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

archive/new-naming-scheme.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,16 @@ for (let file of shaclFiles) {
8181

8282
// rename in frontend
8383

84-
const frontendFile = `${ROOT}/../foerderfunke-react-app/public/assets/data/requirement-profiles/requirement-profiles.json`
85-
let content = await promises.readFile(frontendFile, "utf8")
86-
84+
let jsonFile = `${ROOT}/../foerderfunke-react-app/public/assets/data/requirement-profiles/requirement-profiles.json`
85+
let content = await promises.readFile(jsonFile, "utf8")
8786
for (let [oldUri, newUri] of Object.entries(map)) {
8887
content = content.split(`"${expand(oldUri)}"`).join(`"${expand(newUri)}"`)
8988
}
89+
await promises.writeFile(jsonFile, content, "utf8")
9090

91-
await promises.writeFile(frontendFile, content, "utf8")
91+
jsonFile = `${ROOT}/../foerderfunke-react-app/public/assets/data/requirement-profiles/requirement-profiles-hydration.json`
92+
content = await promises.readFile(jsonFile, "utf8")
93+
for (let [oldUri, newUri] of Object.entries(map)) {
94+
content = content.split(`"${oldUri}"`).join(`"${newUri}"`)
95+
}
96+
await promises.writeFile(jsonFile, content, "utf8")

0 commit comments

Comments
 (0)