Skip to content

Commit 5ea4c3a

Browse files
committed
Export sanity checks seperatly
1 parent 1fc728f commit 5ea4c3a

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Diff for: src/main/checkSanity.ts

+16-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,26 @@ async function doFilesExistCheck(files: string[]): Promise<boolean> {
4040
return true;
4141
}
4242

43+
/**
44+
* Check if the Flashpoint installation that the given path is valid.
45+
*
46+
* @param flashpointPath The path where flashpoint is stored, can be relative.
47+
* @returns true if the Flashpoint installation is valid, false it it's not.
48+
*/
49+
export async function isFlashpointValidCheck(flashpointPath: string): Promise<boolean> {
50+
const importantFiles = getImportantFiles(flashpointPath);
51+
52+
return await doFilesExistCheck(importantFiles);
53+
}
4354

4455
/**
4556
* Check if php is installed on the current system. This is always true on
4657
* Windows since php is bundled with Flashpoint.
58+
*
59+
* @returns true if php is installed, false if it's not. Always returns true on
60+
* Windows.
4761
*/
48-
async function isPhpInstalledCheck() {
62+
export async function isPhpInstalledCheck(): Promise<boolean> {
4963
if (process.platform === 'win32') {
5064
// Flashpoint bundles php on windows.
5165
return true;
@@ -97,10 +111,8 @@ export enum FailedCheck {
97111
* all tests passed.
98112
*/
99113
export default async function checkSanity(config: IAppConfigData) {
100-
const importantFiles = getImportantFiles(config.flashpointPath);
101-
102114
const promiseArray = [
103-
doFilesExistCheck(importantFiles),
115+
isFlashpointValidCheck(config.flashpointPath),
104116
isPhpInstalledCheck(),
105117
];
106118

0 commit comments

Comments
 (0)