-
Notifications
You must be signed in to change notification settings - Fork 8
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
68d7950
commit 85aea69
Showing
4 changed files
with
44 additions
and
6 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
20 changes: 20 additions & 0 deletions
20
packages/common/src/codegen/utils/renderMove/genIdConfig.ts
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,20 @@ | ||
import { ObeliskConfig } from '../../types'; | ||
import { formatAndWriteMove } from '../formatAndWrite'; | ||
|
||
export function generateIdConfig(network: string, packageId: string, worldId: string, savePath: string) { | ||
let code = `type NetworkType = 'testnet' | 'mainnet' | 'devnet' | 'localnet'; | ||
const NETWORK: NetworkType = '${network}'; | ||
const PACKAGE_ID = '${packageId}' | ||
const WORLD_ID = '${worldId}' | ||
export { | ||
NETWORK, | ||
PACKAGE_ID, | ||
WORLD_ID, | ||
} | ||
` | ||
const path = process.cwd() | ||
formatAndWriteMove(code, `${path}/${savePath}`, "formatAndWriteMove"); | ||
} |