rdesktop
filip mertens 1 year ago
parent 92feaa0283
commit 96df90fa1c
  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 () => { app.on('before-quit', async () => {
await appManager.call('fs', 'closeWatch') await appManager.call('fs', 'closeWatch')
console.log('quit')
app.quit() app.quit()
}) })

@ -34,7 +34,7 @@ class FSPluginClient extends PluginClient {
watcher: chokidar.FSWatcher watcher: chokidar.FSWatcher
constructor() { constructor() {
super() 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) createClient(this, profile)
this.onload(() => { this.onload(() => {
console.log('fsPluginClient onload') console.log('fsPluginClient onload')
@ -78,6 +78,10 @@ class FSPluginClient extends PluginClient {
return fs.access(path).then(() => true).catch(() => false) return fs.access(path).then(() => true).catch(() => false)
} }
async currentPath(): Promise<string> {
return process.cwd()
}
async watch(path: string): Promise<void> { async watch(path: string): Promise<void> {
console.log('watch', path) console.log('watch', path)
if(this.watcher) this.watcher.close() 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_WEBPACK_ENTRY: string;
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string; declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
console.log(process.env.PATH);
fixPath(); fixPath();
console.log(process.env.PATH);
// Handle creating/removing shortcuts on Windows when installing/uninstalling. // Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require('electron-squirrel-startup')) { 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 // 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. // code. You can also put them in separate files and import them here.

Loading…
Cancel
Save