Version 0.2.2 - Share: Symlink preferred as File
All checks were successful
Neutral/pipeline/head This commit looks good
All checks were successful
Neutral/pipeline/head This commit looks good
This commit is contained in:
parent
afcb6385c2
commit
52a86f3871
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "neutral",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"description": "Panel d'administration de Raphix",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user