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:
		@@ -124,16 +124,14 @@ module.exports.renameFile = function(settings) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
module.exports.shareFile = 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)) {
 | 
					    if(fs.existsSync(settings.root)) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
					            //Create a sybolic link to shared folder
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            fs.symlinkSync(settings.root + path.sep + settings.name, __glob.SHARED + path.sep + settings.name)
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            fs.copyFileSync(settings.root + path.sep + settings.name, __glob.SHARED + path.sep + settings.name)
 | 
					 | 
				
			||||||
            // return the link of the file shared
 | 
					            // return the link of the file shared
 | 
				
			||||||
            if(process.env.DEV) {
 | 
					            if(process.env.DEV) {
 | 
				
			||||||
                return "http://localhost:3001/shared/" + settings.name
 | 
					                return "http://localhost:3001/shared/" + settings.name
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "neutral",
 | 
					  "name": "neutral",
 | 
				
			||||||
  "version": "0.2.1",
 | 
					  "version": "0.2.2",
 | 
				
			||||||
  "description": "Panel d'administration de Raphix",
 | 
					  "description": "Panel d'administration de Raphix",
 | 
				
			||||||
  "main": "index.js",
 | 
					  "main": "index.js",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user