-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove getBuiltKeystoneConfiguration from createSystem, move to scrip…
…ts/utils
- Loading branch information
Showing
7 changed files
with
53 additions
and
76 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
import { getBuiltKeystoneConfigurationPath } from '../lib/createSystem' | ||
|
||
export class ExitError extends Error { | ||
code: number | ||
constructor (code: number) { | ||
super(`The process exited with Error ${code}`) | ||
this.code = code | ||
} | ||
} | ||
|
||
// TODO: this cannot be changed for now, circular dependency with getSystemPaths, getEsbuildConfig | ||
export async function importBuiltKeystoneConfiguration (cwd: string) { | ||
try { | ||
return require(getBuiltKeystoneConfigurationPath(cwd)).default | ||
} catch (e) { | ||
console.error('🚨 keystone build has not been run') | ||
throw new ExitError(1) | ||
} | ||
} |