Added drag/drop functionality to the add mods button.
You can now drag one or more files onto the add mods button in order to add them to the mods directory. Only jar, litemod, and zip files will be moved. Changed eslint to use a single configuration file, with overrides for the UI scripts. Now using fs-extra, replace usages of rimraf and mkdirp with fs-extra functions.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const fs = require('fs')
|
||||
const mkpath = require('mkdirp')
|
||||
const fs = require('fs-extra')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
|
||||
@@ -98,7 +97,7 @@ exports.load = function(){
|
||||
|
||||
if(!fs.existsSync(filePath)){
|
||||
// Create all parent directories.
|
||||
mkpath.sync(path.join(filePath, '..'))
|
||||
fs.ensureDirSync(path.join(filePath, '..'))
|
||||
config = DEFAULT_CONFIG
|
||||
exports.save()
|
||||
} else {
|
||||
@@ -110,7 +109,7 @@ exports.load = function(){
|
||||
logger.error(err)
|
||||
logger.log('Configuration file contains malformed JSON or is corrupt.')
|
||||
logger.log('Generating a new configuration file.')
|
||||
mkpath.sync(path.join(filePath, '..'))
|
||||
fs.ensureDirSync(path.join(filePath, '..'))
|
||||
config = DEFAULT_CONFIG
|
||||
exports.save()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user