title: How can I take persistent permissions in electron app?
body: <p>I am creating an electron app where I need to scan and update files which need root permission. I know I can run such commands using sudo.exec() in that way: </p>
  
  <pre><code>sudo.exec ("rm /private/var/log/fsck_hfs.log", options, (e, stdout, stderr) =&gt; {});
  </code></pre>
  
  <p>And even I can put multiple commands in a script and execute them with single sudo.exec(). In my case, commands needs to be executed at different point of time and I cannot execute them with a single script. It is annoying for user to grant permissions again and again. </p>
  
  <p>I tried to do it another way (to run a piece of code where everything that require root permission can be executed). For that, I posted another question <a href="https://stackoverflow.com/questions/54052974/writing-code-inside-sudo-exec-in-electron-app">here</a>. But it seems that it is not possible.</p>
  
  <p>Now I want a way to get permission once when use install app (as most of the apps does after user install them) and be able to use throughout the app sudo.exec() or some other method to execute commands (preferably also the code fs.readdir, etc) that require root permission. </p>