Esempio n. 1
0
 /**
  * Check the existence of a file or folder.
  *
  * @param {String} path Path of the file or folder.
  *
  * @return {Boolean} True if exists. Otherwise false.
  */
 static existsSync( path ) {
   try {
     Fs.accessSync( path, Fs.F_OK );
     return true;
   } catch( err ) {
     return false;
   }
 }
Esempio n. 2
0
 *   [Vue](https://vuejs.org)
 *   [Electron](https://electron.atom.io)
 *   [Desktop UI](https://github.com/zce/desktop-ui)
 *   [Electron Bolierplate](https://github.com/zce/electron-boilerplate)
 *   etc.
 *
 * Copyright 2015-2016 WEDN, Inc. and other contributors
 */

process.env.NODE_ENV = process.env.NODE_ENV || 'production'

const os = require('os')
const fs = require('original-fs')
const path = require('path')
const electron = require('electron')
const manifestFilename = path.resolve(os.tmpdir(), electron.app.getName(), 'manifest.json')

try {
  fs.accessSync(manifestFilename, fs.constants.R_OK)
  const manifest = JSON.parse(fs.readFileSync(manifestFilename, 'utf8'))
  manifest.forEach(item => {
    fs.writeFileSync(item.to, fs.readFileSync(item.from))
    fs.unlinkSync(item.from)
  })
  fs.unlinkSync(manifestFilename)
} catch (e) {
  console.log(e.message)
}

require('./core.asar')