fiix expandpath

pull/4346/head
filip mertens 12 months ago
parent 8efdbb3a5b
commit feb7535fd7
  1. 6
      apps/remix-ide/src/app/files/dgitProvider.ts
  2. 2
      apps/remix-ide/src/app/plugins/electron/compilerLoaderPlugin.ts
  3. 28
      apps/remix-ide/src/app/plugins/electron/scriptRunnerPlugin.ts
  4. 8
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts

@ -459,7 +459,7 @@ class DGitProvider extends Plugin {
if (gitmodules) {
const lines = gitmodules.split('\n')
let currentModule:any = {}
let modules = []
const modules = []
for (let line of lines) {
line = line.trim()
if (line.startsWith('[')) {
@ -491,7 +491,7 @@ class DGitProvider extends Plugin {
this.call('terminal', 'logHtml', `Found ${(gitmodules && gitmodules.length) || 0} submodules in ${currentDir || '/'}`)
//parse gitmodules
if (gitmodules) {
for (let module of gitmodules) {
for (const module of gitmodules) {
const dir = path.join(currentDir, module.path)
const targetPath = (await this.getGitConfig(dir)).dir
if (await window.remixFileSystem.exists(targetPath)) {
@ -505,7 +505,7 @@ class DGitProvider extends Plugin {
}
}
}
for (let module of gitmodules) {
for (const module of gitmodules) {
const dir = path.join(currentDir, module.path)
// if url contains git@github.com: convert it
if(module.url && module.url.startsWith('git@github.com:')) {

@ -19,7 +19,7 @@ export class compilerLoaderPlugin extends Plugin {
}
async getJsonBinData() {
let response: iSolJsonBinData = {
const response: iSolJsonBinData = {
baseURLBin: '',
baseURLWasm: '',
binList: [],

@ -12,20 +12,20 @@ export class scriptRunnerPlugin extends ElectronPlugin {
}
async onActivation(): Promise<void> {
this.on('scriptRunner', 'missingModule', async (module: string) => {
console.log('missingModule', module)
const addModuleModal: AppModal = {
id: 'AddModuleModal',
title: `Missing module ${module}`,
message: `Do you want to install the missing module? ${module} \n\nYou can also install it manually using the terminal if you have yarn or npm installed:\nyarn add ${module}`,
okLabel: 'Install',
cancelLabel: 'No',
}
const result = await this.call('notification', 'modal', addModuleModal)
if (result) {
await this.addModule(module)
}
})
this.on('scriptRunner', 'missingModule', async (module: string) => {
console.log('missingModule', module)
const addModuleModal: AppModal = {
id: 'AddModuleModal',
title: `Missing module ${module}`,
message: `Do you want to install the missing module? ${module} \n\nYou can also install it manually using the terminal if you have yarn or npm installed:\nyarn add ${module}`,
okLabel: 'Install',
cancelLabel: 'No',
}
const result = await this.call('notification', 'modal', addModuleModal)
if (result) {
await this.addModule(module)
}
})
}
async addModule(module: string, version: string = ''): Promise<void> {

@ -327,6 +327,10 @@ export const browserReducer = (state = browserInitialState, action: Actions) =>
state.mode === 'browser'
? fileAdded(state, payload)
: state.browser.files,
expandPath:
state.mode === 'browser'
? [...new Set([...state.browser.expandPath, payload])]
: state.browser.expandPath
},
localhost: {
...state.localhost,
@ -353,6 +357,10 @@ export const browserReducer = (state = browserInitialState, action: Actions) =>
state.mode === 'browser'
? fetchDirectoryContent(state, payload)
: state.browser.files,
expandPath:
state.mode === 'browser'
? [...new Set([...state.browser.expandPath, payload.folderPath])]
: state.browser.expandPath
},
localhost: {
...state.localhost,

Loading…
Cancel
Save