|
|
|
@ -11,6 +11,7 @@ import { getValidLanguage } from '@remix-project/remix-solidity' |
|
|
|
|
import { CopyToClipboard } from '@remix-ui/clipboard' |
|
|
|
|
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
|
|
|
|
|
import * as json_config from '../../../../../apps/remix-ide/contracts/solidity_compiler_config.json' |
|
|
|
|
import { readFileSync } from 'fs' |
|
|
|
|
|
|
|
|
|
import './css/style.css' |
|
|
|
|
|
|
|
|
@ -92,7 +93,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
|
const autocompile = await api.getAppParameter('autoCompile') as boolean || false |
|
|
|
|
const hideWarnings = await api.getAppParameter('hideWarnings') as boolean || false |
|
|
|
|
const includeNightlies = await api.getAppParameter('includeNightlies') as boolean || false |
|
|
|
|
const useFileConfiguration = await api.getAppParameter('useFileConfiguration') as boolean || true |
|
|
|
|
const useFileConfiguration = await api.getAppParameter('useFileConfiguration') as boolean || false |
|
|
|
|
let configFilePath = await api.getAppParameter('configFilePath') |
|
|
|
|
console.log("in useeff init ", configFilePath) |
|
|
|
|
if (!configFilePath || configFilePath == '') configFilePath = "/compiler_config.json" |
|
|
|
@ -187,7 +188,19 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const createNewConfigFile = async () => { |
|
|
|
|
if (json_config.default) json_config.default = null |
|
|
|
|
const configFileContent = JSON.stringify(json_config, null, '\t') |
|
|
|
|
console.log("file content as string -> ", json_config) |
|
|
|
|
console.log("file content as json -> ", configFileContent) |
|
|
|
|
try { |
|
|
|
|
const contentContent: string = readFileSync('../../../../../apps/remix-ide/contracts/solidity_compiler_config.json', 'utf8') |
|
|
|
|
console.log("content is ", contentContent) |
|
|
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
|
console.log(err); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const filePath = configFilePathInput.current && configFilePathInput.current.value !== '' ? configFilePathInput.current.value : state.configFilePath |
|
|
|
|
await api.writeFile(filePath, configFileContent) |
|
|
|
|
console.log("createNewConfigFile ", filePath) |
|
|
|
|