Skip to content

Commit

Permalink
writeXml func before use
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofbyteball committed Jun 22, 2018
1 parent cb2f587 commit 60d7147
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/js/services/go.js
Expand Up @@ -233,11 +233,6 @@ X-Ubuntu-StageHint=SideStage\n", {mode: 0755}, function(err){
child_process.exec('update-desktop-database '+applicationsDir, function(err){
if (err)
throw Error("failed to exec update-desktop-database: "+err);
if (!fs.existsSync(mimeDir + '/packages')) {
fileSystemService.recursiveMkdir(mimeDir + '/packages', parseInt('755', 8), function(err){
writeXml();
});
} else writeXml();
var writeXml = function() {
fs.writeFile(mimeDir + '/packages/' + package.name+'.xml', "<?xml version=\"1.0\"?>\n\
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>\n\
Expand All @@ -256,6 +251,13 @@ X-Ubuntu-StageHint=SideStage\n", {mode: 0755}, function(err){
console.log(".desktop done");
});
};
if (!fs.existsSync(mimeDir + '/packages')) {
fileSystemService.recursiveMkdir(mimeDir + '/packages', parseInt('755', 8), function(err){
writeXml();
});
}
else
writeXml();
});
});
});
Expand Down

0 comments on commit 60d7147

Please sign in to comment.