rdesktop2
filip mertens 1 year ago
parent 9c3283c017
commit c104f7056a
  1. 11
      apps/remixdesktop/src/main.ts
  2. 2
      apps/remixdesktop/src/plugins/xtermPlugin.ts
  3. 55
      apps/remixdesktop/src/tools/search.ts

@ -150,11 +150,11 @@ export interface SearchResultLine {
} }
import * as cp from 'child_process'; //import * as cp from 'child_process';
import { rgPath } from '@vscode/ripgrep'; //import { rgPath } from '@vscode/ripgrep';
const rgDiskPath = rgPath.replace(/\bnode_modules\.asar\b/, 'node_modules.asar.unpacked'); //const rgDiskPath = rgPath.replace(/\bnode_modules\.asar\b/, 'node_modules.asar.unpacked');
console.log('rgDiskPath', rgDiskPath) //console.log('rgDiskPath', rgDiskPath)
// ripgrep // ripgrep
// -s means case sensitive // -s means case sensitive
@ -166,6 +166,7 @@ console.log('rgDiskPath', rgDiskPath)
Include or exclude files and directories for searching that match the given glob. This always overrides any other ignore logic. Multiple glob flags may be used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude it. If multiple globs match a file or directory, the glob given later in the command line takes precedence. Include or exclude files and directories for searching that match the given glob. This always overrides any other ignore logic. Multiple glob flags may be used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude it. If multiple globs match a file or directory, the glob given later in the command line takes precedence.
*/ */
/*
console.log('process.cwd()', process.cwd()) console.log('process.cwd()', process.cwd())
const child = cp.spawn(rgDiskPath, ['bunsens[a-z]*', '--json', './'], { cwd: process.cwd() }); const child = cp.spawn(rgDiskPath, ['bunsens[a-z]*', '--json', './'], { cwd: process.cwd() });
@ -229,5 +230,5 @@ child.on('exit', (code) => {
console.log('exit', code) console.log('exit', code)
} }
) )
*/

@ -80,7 +80,7 @@ class XtermPluginClient extends ElectronBasePluginClient {
const ptyProcess = pty.spawn(shell, [], { const ptyProcess = pty.spawn(shell, [], {
name: 'xterm-color', name: 'xterm-color',
cols: 80, cols: 80,
rows: 30, rows: 20,
cwd: path || process.cwd(), cwd: path || process.cwd(),
//env: process.env //env: process.env
}); });

@ -1,55 +0,0 @@
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;
}
}
}
Loading…
Cancel
Save