rdesktop^2
filip mertens 1 year ago
parent f68b189969
commit 0b878097cb
  1. 1
      apps/1test/src/electron/engine.ts
  2. 6
      apps/1test/src/electron/fsPlugin.ts
  3. 4
      apps/1test/src/index.ts

@ -22,6 +22,5 @@ ipcMain.handle('engine:activatePlugin', async (event, arg) => {
app.on('before-quit', async () => {
await appManager.call('fs', 'closeWatch')
console.log('quit')
app.quit()
})

@ -34,7 +34,7 @@ class FSPluginClient extends PluginClient {
watcher: chokidar.FSWatcher
constructor() {
super()
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'exists', 'watch', 'closeWatch']
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'exists', 'watch', 'closeWatch', 'currentPath']
createClient(this, profile)
this.onload(() => {
console.log('fsPluginClient onload')
@ -78,6 +78,10 @@ class FSPluginClient extends PluginClient {
return fs.access(path).then(() => true).catch(() => false)
}
async currentPath(): Promise<string> {
return process.cwd()
}
async watch(path: string): Promise<void> {
console.log('watch', path)
if(this.watcher) this.watcher.close()

@ -7,9 +7,7 @@ import fixPath from 'fix-path';
declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
console.log(process.env.PATH);
fixPath();
console.log(process.env.PATH);
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require('electron-squirrel-startup')) {
@ -59,5 +57,3 @@ app.on('activate', () => {
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and import them here.

Loading…
Cancel
Save