removed dependency on fswin (did not work out of the box on nw) and now the hidden flag is set via spawning attrib...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-06-06 01:10:36 +03:00
parent 9618ffeab5
commit 82e10ff27e
2 changed files with 11 additions and 19 deletions

View File

@ -11,17 +11,11 @@ define(function(require){ var module = {}
// XXX this should not be imported!!!
// ...something wrong with requirejs(..)
if(typeof(process) != 'undefined'){
var child_process = requirejs('child_process')
var fse = requirejs('fs-extra')
var pathlib = requirejs('path')
var glob = requirejs('glob')
// Windows specific stuff...
try{
var fswin = requirejs('fswin')
}catch(err){
var fswin = null
}
var file = require('imagegrid/file')
}
@ -1450,9 +1444,10 @@ var FileSystemWriterActions = actions.Actions({
this.config['index-filename-template'],
logger)
.then(function(){
fswin && fswin.setAttributeSync(full_path, {
IS_HIDDEN: true,
})
typeof(process) != 'undefined'
&& process.platform == 'win32'
&& child_process
.spawn('attrib', ['+h', full_path])
})
.then(function(){
location.method = 'loadIndex'
@ -1591,16 +1586,14 @@ var FileSystemWriterActions = actions.Actions({
this.config['index-filename-template'],
logger || this.logger)
.then(function(){
fswin && fswin.setAttributeSync(index_path, {
IS_HIDDEN: true,
})
typeof(process) != 'undefined'
&& process.platform == 'win32'
// XXX do we need to quote path???
&& child_process
.spawn('attrib', ['+h', index_path])
}))
return Promise.all(queue)
.then(function(){
return that.location
})
}],
// XXX might also be good to save/load the export options to .ImageGrid-export.json

View File

@ -19,7 +19,6 @@
"app-module-path": "^1.0.6",
"commander": "^2.9.0",
"exiftool": "^0.0.3",
"flickrapi": "^0.3.28",
"fs-extra": "*",
"fs-walk": "^0.0.1",
"glob": "^4.0.6",
@ -29,7 +28,7 @@
"sharp": "^0.12.0"
},
"optionalDependencies": {
"fswin": "*"
"flickrapi": "^0.3.28",
},
"devDependencies": {
"less": "*",