From 52a86f38716cbdbeb839a91822493df1ba67f14c Mon Sep 17 00:00:00 2001 From: Raphix Date: Fri, 3 Nov 2023 22:28:58 +0100 Subject: [PATCH] Version 0.2.2 - Share: Symlink preferred as File --- bin/files.js | 8 +++----- package.json | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) 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": {