Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function download(url, options = {}) {
const bus = new EventBus()
// eslint-disable-next-line no-param-reassign
options = {
showSaveAs: false,
directory: app.getPath('downloads'),
filename: basename(url).split('?')[0].split('#')[0],
...options,
}
let filepath = join(options.directory, options.filename)
let cancelled = false
if (options.showSaveAs) {
// save as dialog
filepath = dialog.showSaveDialogSync({
defaultPath: filepath,
// body preferences
args.push('--bsize', preferences.body.boobs.size)
args.push('--asize', preferences.body.areola.size)
args.push('--nsize', preferences.body.nipple.size)
args.push('--vsize', preferences.body.vagina.size)
args.push('--hsize', preferences.body.pubicHair.size)
logger.info('Spawning DreamPower.', {
input: inputFilepath,
output: outputFilepath,
args,
})
const process = exec(args)
const bus = new EventBus()
process.on('error', (error) => {
logger.error(error)
bus.emit('error', null, error)
})
process.stdout.on('data', (output) => {
const stdout = output.toString().trim().split('\n')
bus.emit('stdout', null, stdout)
})
process.stderr.on('data', (output) => {
logger.warn(`stderr: ${output}`)
bus.emit('stderr', null, output)
})
// DreamTime.
// Copyright (C) DreamNet. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License 3.0 as published by
// the Free Software Foundation. See
//
// Written by Ivan Bravo Bravo , 2019.
import EventBus from 'js-event-bus'
export const events = new EventBus()