rdesktop2
bunsenstraat 1 year ago
parent f927730171
commit 3b04e0df7c
  1. 3
      apps/remixdesktop/package.json
  2. 26
      apps/remixdesktop/src/main.ts
  3. 55
      apps/remixdesktop/src/tools/search.ts
  4. 13
      apps/remixdesktop/yarn.lock

@ -41,6 +41,7 @@
"@remixproject/engine-electron": "0.3.37", "@remixproject/engine-electron": "0.3.37",
"@remixproject/plugin": "0.3.37", "@remixproject/plugin": "0.3.37",
"@remixproject/plugin-electron": "0.3.37", "@remixproject/plugin-electron": "0.3.37",
"@vscode/ripgrep": "^1.15.4",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"glob": "9.3.5", "glob": "9.3.5",
"isomorphic-git": "^1.24.2", "isomorphic-git": "^1.24.2",
@ -102,4 +103,4 @@
"output": "release" "output": "release"
} }
} }
} }

@ -97,6 +97,7 @@ import EditMenu from './menus/edit';
import GitMenu from './menus/git'; import GitMenu from './menus/git';
import ViewMenu from './menus/view'; import ViewMenu from './menus/view';
import { execCommand } from './menus/commands'; import { execCommand } from './menus/commands';
import { searchProxy } from './tools/search';
const commandKeys: Record<string, string> = { const commandKeys: Record<string, string> = {
'window:new': 'CmdOrCtrl+N', 'window:new': 'CmdOrCtrl+N',
@ -111,4 +112,27 @@ ViewMenu(commandKeys, execCommand),
WindowMenu(commandKeys, execCommand, []), WindowMenu(commandKeys, execCommand, []),
] ]
Menu.setApplicationMenu(Menu.buildFromTemplate(menu)) Menu.setApplicationMenu(Menu.buildFromTemplate(menu))
/*
searchProxy.checkIfGrepIsInstalled().then((result) => {
console.log('grep --version', result)
})
searchProxy.checkIffindstrIsInstalled().then((result) => {
console.log('findstr /?', result)
})
searchProxy.checkIfSelectStringIsInstalled().then((result) => {
console.log('get-help Select-String', result)
})
*/
searchProxy.checkIfRgIsInstalled().then((result) => {
console.log('rg --version', result)
}
).catch((error) => {
console.log('rg --version', error)
})

@ -0,0 +1,55 @@
import { exec } from 'child_process';
import { CommitObject, ReadCommitResult } from 'isomorphic-git';
import { promisify } from 'util';
import { rgPath } from '@vscode/ripgrep';
const rgDiskPath = rgPath.replace(/\bnode_modules\.asar\b/, 'node_modules.asar.unpacked');
const execAsync = promisify(exec);
export const searchProxy = {
checkIfGrepIsInstalled: async () => {
try {
const result = await execAsync('grep --version');
console.log('grep --version', result.stdout)
return result.stdout
} catch (error) {
return false;
}
},
checkIffindstrIsInstalled: async () => {
try {
const result = await execAsync('findstr /?');
console.log('findstr /?', result.stdout)
return result.stdout
} catch (error) {
return false;
}
},
checkIfSelectStringIsInstalled: async () => {
try {
const result = await execAsync('get-help Select-String');
console.log('get-help Select-String', result.stdout)
return result.stdout
} catch (error) {
return false;
}
},
checkIfRgIsInstalled: async () => {
try {
const result = await execAsync(`${rgDiskPath} 'remix'`, { cwd: process.cwd(), env: { PATH: process.env.PATH }});
console.log('rg --version', result.stdout)
return result.stdout
} catch (error) {
return false;
}
}
}

@ -701,6 +701,14 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@vscode/ripgrep@^1.15.4":
version "1.15.4"
resolved "https://registry.yarnpkg.com/@vscode/ripgrep/-/ripgrep-1.15.4.tgz#ca8946b5580bbea1e706ed8d3b1eed5f0d551ab6"
integrity sha512-+EPIS2aoD95MFLrgGHd/D2fck42aMRV2cBrT7BiNvKBeSyCTybSaTJ+PGQf6zV/95AhaXHHYqYPVRk3DZoGU9w==
dependencies:
https-proxy-agent "^5.0.0"
proxy-from-env "^1.1.0"
abbrev@^1.0.0: abbrev@^1.0.0:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
@ -3757,6 +3765,11 @@ proxy-addr@~2.0.7:
forwarded "0.2.0" forwarded "0.2.0"
ipaddr.js "1.9.1" ipaddr.js "1.9.1"
proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
psl@^1.1.28: psl@^1.1.28:
version "1.9.0" version "1.9.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"

Loading…
Cancel
Save