mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	- Improve path resolution for backup and restore commands
- Closes https://github.com/inventree/InvenTree/issues/8207
(cherry picked from commit 73a3e504a9)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							974c2737af
						
					
				
				
					commit
					83be1b8a0f
				
			
							
								
								
									
										10
									
								
								tasks.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								tasks.py
									
									
									
									
									
								
							@@ -411,6 +411,11 @@ def backup(c, clean=False, path=None):
 | 
			
		||||
    cmd = '--noinput --compress -v 2'
 | 
			
		||||
 | 
			
		||||
    if path:
 | 
			
		||||
        # Resolve the provided path
 | 
			
		||||
        path = Path(path)
 | 
			
		||||
        if not os.path.isabs(path):
 | 
			
		||||
            path = localDir().joinpath(path).resolve()
 | 
			
		||||
 | 
			
		||||
        cmd += f' -O {path}'
 | 
			
		||||
 | 
			
		||||
    if clean:
 | 
			
		||||
@@ -442,6 +447,11 @@ def restore(
 | 
			
		||||
    base_cmd = '--noinput --uncompress -v 2'
 | 
			
		||||
 | 
			
		||||
    if path:
 | 
			
		||||
        # Resolve the provided path
 | 
			
		||||
        path = Path(path)
 | 
			
		||||
        if not os.path.isabs(path):
 | 
			
		||||
            path = localDir().joinpath(path).resolve()
 | 
			
		||||
 | 
			
		||||
        base_cmd += f' -I {path}'
 | 
			
		||||
 | 
			
		||||
    if ignore_database:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user