Skip to content

Commit

Permalink
use sudo with appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
papajoker committed Aug 31, 2016
1 parent 381a4b3 commit 849657b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/ace-builds/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@
</style>
<link href="../../assets/css/font-awesome.css" rel="stylesheet" type="text/css" />
<script>
'use strict'
const {
remote
} = require('electron')
const fs = require('fs')
var path = require('path');
var sudo = require('sudo-prompt');
var path = require('path')
var sudo = require('sudo-prompt')
const theme = remote.getCurrentWindow().mainTheme
var file = remote.getCurrentWindow().file
var saveas = false

// load only text files
let mimetype=require('child_process').execSync(`file -bi ${file} 2>/dev/null`,{ encoding:'utf8'})+''
if ((mimetype.slice(0,4)!='text')) remote.getCurrentWindow().close();
if ((mimetype.slice(0,4)!='text')) remote.getCurrentWindow().close()

document.write('<link href="../../assets/css/themes/' + theme + '/bootstrap.css" rel="stylesheet" type="text/css" />')
</script>
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
"app-category-type": "system",
"productName": "sys-journald",
"compression": "maximum"
},
"dependencies": {
"sudo-prompt": "^6.2.0"
}
}

0 comments on commit 849657b

Please sign in to comment.