Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
files.filter(file => file.endsWith('.desktop')).forEach(file => {
try {
var entry = properties(localStorage.autostartApps + '/' + file)
if (entry.get('Desktop Entry.Name') != null) {
let appName = entry.get('Desktop Entry.Name')
let isStart = entry.get('Desktop Entry.X-GNOME-Autostart-enabled')
let appComment = entry.get('Desktop Entry.Comment')
let appExec = entry.get('Desktop Entry.Exec')
if (appName != null) {
this.apps.push({
name: appName,
Exec:appExec,
comment:appComment,
file: file,
isStart: (isStart != null ? isStart : true)
})
}
}
export function createPropertyReader(path: string | string[]) {
const paths = Array.isArray(path) ? path : [path];
const [head, ...files] = paths;
let reader = PropertiesReader(head);
for (let i = 0; i < files.length; i++) {
reader = reader.append(files[i]);
}
return reader;
}
fileExists(path.join(os.homedir(), '.lbrycrd/lbrycrd.conf'), (err, exists) => {
if (err) { reject(err) };
let config = {'username': 'lbry', 'password': 'lbry', 'rpc_port': 9245};
if (exists) {
let prop = PropertiesReader(path.join(os.homedir(), '.lbrycrd/lbrycrd.conf'));
config.username = prop.get('rpcuser');
config.password = prop.get('rpcpassword');
config.rpc_port = prop.get('rpcport');
let client = new bitcoin.Client({
host : 'localhost',
port : config.rpc_port,
user : config.username,
pass : config.password,
timeout: 30000,
});
resolve(client);
} else {
let client = new bitcoin.Client({
host : 'localhost',
port : config.rpc_port,
user : config.username,
.forEach( file =>
{
try {
var entry = properties(commands.autostartApps+ '/' + file)
if ( entry.get('Desktop Entry.Name') != null )
{
let appName = entry.get('Desktop Entry.Name')
let isStart = entry.get('Desktop Entry.X-GNOME-Autostart-enabled')
if ( appName != null ){
apps.push( {
name: appName,
file: file,
isStart: ( isStart != null ? isStart: true )
})
}
}
}
catch(err){}