feat: introduce temp dir helper
This commit is contained in:
		
							
								
								
									
										7
									
								
								fs/fs.go
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								fs/fs.go
									
									
									
									
									
								
							| @@ -3,6 +3,8 @@ package fs | |||||||
| import ( | import ( | ||||||
| 	"os" | 	"os" | ||||||
| 	"path/filepath" | 	"path/filepath" | ||||||
|  |  | ||||||
|  | 	"code.dumpstack.io/tools/out-of-tree/config" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| // CaseInsensitive check | // CaseInsensitive check | ||||||
| @@ -44,3 +46,8 @@ func PathExists(path string) bool { | |||||||
| 	} | 	} | ||||||
| 	return true | 	return true | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // TempDir that exist relative to config directory | ||||||
|  | func TempDir() (string, error) { | ||||||
|  | 	return os.MkdirTemp(config.Dir("tmp"), "") | ||||||
|  | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user