pull/5324/head
bunsenstraat 1 month ago
parent 9c5afefb99
commit 1ed044eae0
  1. 2
      apps/remix-ide/src/app/components/panel.ts
  2. 18
      apps/remix-ide/src/app/tabs/script-runner-ui.tsx
  3. 1
      libs/remix-api/src/lib/plugins/fileSystem-api.ts

@ -23,8 +23,6 @@ export class AbstractPanel extends HostPlugin {
}
addView (profile, view) {
console.log('addView', profile, view)
console.log('this', this.plugins)
if (this.plugins[profile.name]) throw new Error(`Plugin ${profile.name} already rendered`)
this.plugins[profile.name] = {
profile: profile,

@ -23,7 +23,7 @@ const profile = {
maintainedBy: 'Remix'
}
const configFileName = 'script.config.json'
const configFileName = '.remix/script.config.json'
let baseUrl = 'http://localhost:3000'
let customBuildUrl = 'http://localhost:4000/build'
@ -295,8 +295,6 @@ export class ScriptRunnerUIPlugin extends ViewPlugin {
}
async loadCustomConfig(): Promise<void> {
console.log('loadCustomConfig')
//await this.plugin.call('fileManager', 'open', 'script.config.json')
try {
const content = await this.plugin.call('fileManager', 'readFile', configFileName)
console.log('loadCustomConfig', content)
@ -317,7 +315,7 @@ export class ScriptRunnerUIPlugin extends ViewPlugin {
async openCustomConfig() {
try {
await this.plugin.call('fileManager', 'open', 'script.config.json')
await this.plugin.call('fileManager', 'open', '.remix/script.config.json')
} catch (e) {
}
@ -347,7 +345,17 @@ export class ScriptRunnerUIPlugin extends ViewPlugin {
async saveCustomConfig(content: ScriptRunnerConfig) {
console.log('saveCustomConfig', content)
await this.plugin.call('fileManager', 'writeFile', 'script.config.json', JSON.stringify(content, null, 2))
if (content.customConfig.dependencies.length === 0 && content.defaultConfig === 'default') {
try {
const exists = await this.plugin.call('fileManager', 'exists', '.remix/script.config.json')
if (exists) {
await this.plugin.call('fileManager', 'remove', '.remix/script.config.json')
}
} catch (e) {
}
return
}
await this.plugin.call('fileManager', 'writeFile', '.remix/script.config.json', JSON.stringify(content, null, 2))
}
async activateCustomScriptRunner(config: customScriptRunnerConfig) {

@ -9,5 +9,6 @@ export interface IExtendedFileSystem extends IFileSystem {
refresh(): Promise<void>
hasGitSubmodules(): Promise<boolean>
isGitRepo(): Promise<boolean>
exists(file: string): Promise<boolean>
};
}
Loading…
Cancel
Save