-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from FlashpointProject/feat/testing
feat: Testing Improvements
- Loading branch information
Showing
20 changed files
with
206 additions
and
197 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
Submodule core-curation
deleted from
edb028
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,34 @@ | ||
import { FPFSS_INFO_FILENAME } from '@shared/curate/fpfss'; | ||
import { str } from '@shared/utils/Coerce'; | ||
import { ObjectParser } from '@shared/utils/ObjectParser'; | ||
import { CurationFpfssInfo } from 'flashpoint-launcher'; | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
export async function getCurationFpfssInfo(folder: string): Promise<CurationFpfssInfo | null> { | ||
return fs.promises.readFile(path.join(folder, FPFSS_INFO_FILENAME), { encoding: 'utf-8' }) | ||
.then((dataStr) => { | ||
return parseCurationFpfssInfo(JSON.parse(dataStr)); | ||
}) | ||
.catch(() => { | ||
return null; | ||
}); | ||
} | ||
|
||
export async function saveCurationFpfssInfo(folder: string, info: CurationFpfssInfo) { | ||
const data = parseCurationFpfssInfo(info); | ||
return fs.promises.writeFile(path.join(folder, FPFSS_INFO_FILENAME), JSON.stringify(data, undefined, 2)); | ||
} | ||
|
||
export function parseCurationFpfssInfo(data: any): CurationFpfssInfo { | ||
const info: CurationFpfssInfo = { | ||
id: '' | ||
}; | ||
|
||
const parser = new ObjectParser({ | ||
input: data | ||
}); | ||
parser.prop('id', v => info.id = str(v)); | ||
|
||
return info; | ||
} |
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.