-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33ab064
commit a31f95e
Showing
12 changed files
with
419 additions
and
88 deletions.
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,23 @@ | ||
import { join } from 'path'; | ||
|
||
import { fetchAllServerStrings, writeFileAsync } from "../utils"; | ||
|
||
async function exportStrings( | ||
apiUrl: string, | ||
outputDir: string, | ||
) { | ||
const serverStrings = await fetchAllServerStrings(apiUrl); | ||
|
||
const url = new URL(apiUrl); | ||
const now = new Date(); | ||
const exportFileName = `${url.hostname}-${now.getTime()}.json`; | ||
const exportFilePath = join(outputDir, exportFileName); | ||
|
||
await writeFileAsync( | ||
exportFilePath, | ||
JSON.stringify(serverStrings, null, 2), | ||
'utf8', | ||
); | ||
} | ||
|
||
export default exportStrings; |
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
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
Oops, something went wrong.