Is this Node.js and can it be changed to return without action?
by allend from LinuxQuestions.org on (#5PBHX)
Microsoft Teams for Linux has the annoying habit of automatically populating the user's autostart file when run after being installed or updated. I know this can be turned off from within teams, but I would prefer that this behaviour did not happen.
Looking at the /usr/share/teams/resources/app.asar file in the latest version of teams (1.4.00.13653), I have identified this code snippet that I have tried to format for readability.
The 'writeFileSync' suggests this might be Node.js, of which I have no knowledge
Code:setUpLinuxAutoStartFile(e){
const t=r.join(c.homedir(),".config","autostart"),
n=r.
join(t,p.getAppName()+".desktop");
try{if(e.openAtLogin){s.existsSync(t)||s.mkdirSync(t,{recursive:!0});
const e=["[Desktop Entry]",
"Version=1.0",
"Type=Application",
"Encoding=UTF-8",
"Name="+p.getAppDisplayName(),
"Exec=/usr/bin/"+p.getAppName()+" %U",
"Icon="+p.getAppName(),
"Terminal=false",
"StartupNotify=false",
"Categories=Network;Application;",
"MimeType=x-scheme-handler/msteams;",
"X-GNOME-Autostart-enabled=true",
"X-KDE-Protocols=teams"].join("\n");
s.writeFileSync(n,e)}
else
s.existsSync(n)&&s.unlinkSync(n)}catch(t){h.getInstance().logWarning("Error occurred while working with autoStart file "+n+";
was writing file = "+e.openAtLogin+"; error: "+p.sanitizeError(t))}}Any thoughts on how to get this to be a NOOP?
Looking at the /usr/share/teams/resources/app.asar file in the latest version of teams (1.4.00.13653), I have identified this code snippet that I have tried to format for readability.
The 'writeFileSync' suggests this might be Node.js, of which I have no knowledge
Code:setUpLinuxAutoStartFile(e){
const t=r.join(c.homedir(),".config","autostart"),
n=r.
join(t,p.getAppName()+".desktop");
try{if(e.openAtLogin){s.existsSync(t)||s.mkdirSync(t,{recursive:!0});
const e=["[Desktop Entry]",
"Version=1.0",
"Type=Application",
"Encoding=UTF-8",
"Name="+p.getAppDisplayName(),
"Exec=/usr/bin/"+p.getAppName()+" %U",
"Icon="+p.getAppName(),
"Terminal=false",
"StartupNotify=false",
"Categories=Network;Application;",
"MimeType=x-scheme-handler/msteams;",
"X-GNOME-Autostart-enabled=true",
"X-KDE-Protocols=teams"].join("\n");
s.writeFileSync(n,e)}
else
s.existsSync(n)&&s.unlinkSync(n)}catch(t){h.getInstance().logWarning("Error occurred while working with autoStart file "+n+";
was writing file = "+e.openAtLogin+"; error: "+p.sanitizeError(t))}}Any thoughts on how to get this to be a NOOP?