tmp: Fix accidentally creating two directories
This commit is contained in:
		
							
								
								
									
										5
									
								
								tmp
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								tmp
									
									
									
									
									
								
							@@ -9,10 +9,6 @@
 | 
				
			|||||||
# Define variables
 | 
					# Define variables
 | 
				
			||||||
name="$(basename "$0" .sh)"
 | 
					name="$(basename "$0" .sh)"
 | 
				
			||||||
tmpdirtemplate="XXXXXX"
 | 
					tmpdirtemplate="XXXXXX"
 | 
				
			||||||
tmpdir="$(mktemp -d)"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Verify them
 | 
					 | 
				
			||||||
[ -z "$tmpdir" ] && exit 2
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Define functions
 | 
					# Define functions
 | 
				
			||||||
log() {
 | 
					log() {
 | 
				
			||||||
@@ -74,6 +70,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Make our directory
 | 
					# Make our directory
 | 
				
			||||||
tmpdir="$(mktemp -dt "tmp.$tmpdirtemplate")"
 | 
					tmpdir="$(mktemp -dt "tmp.$tmpdirtemplate")"
 | 
				
			||||||
 | 
					[ -z "$tmpdir" ] && exit 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Copy in template directory
 | 
					# Copy in template directory
 | 
				
			||||||
if [ -n "$1" ] && [ -n "$copydir" ] && [ -n "$tmpdir" ]; then
 | 
					if [ -n "$1" ] && [ -n "$copydir" ] && [ -n "$tmpdir" ]; then
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user