diff --git a/bin/files.js b/bin/files.js index 4a4d4c8..18266f1 100644 --- a/bin/files.js +++ b/bin/files.js @@ -124,16 +124,14 @@ module.exports.renameFile = function(settings) { module.exports.shareFile = function(settings) { - //It's gonna coopy the file in the shared folder - // And return the link of the file - // The link is gonna be like this : http://localhost:3000/shared/name of file - // The file is gonna be in the shared folder if(fs.existsSync(settings.root)) { try { + //Create a sybolic link to shared folder - fs.copyFileSync(settings.root + path.sep + settings.name, __glob.SHARED + path.sep + settings.name) + fs.symlinkSync(settings.root + path.sep + settings.name, __glob.SHARED + path.sep + settings.name) + // return the link of the file shared if(process.env.DEV) { return "http://localhost:3001/shared/" + settings.name diff --git a/package.json b/package.json index d617a43..1e276bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neutral", - "version": "0.2.1", + "version": "0.2.2", "description": "Panel d'administration de Raphix", "main": "index.js", "scripts": {