Generate a filename given some hints that are used to 'weigh in' on the aesthetics
(storageHint string, filenameHint string)
| 112 | |
| 113 | // Generate a filename given some hints that are used to 'weigh in' on the aesthetics |
| 114 | func fsFilename(storageHint string, filenameHint string) string { |
| 115 | // If no filename is specified, default it |
| 116 | if filenameHint == "" { |
| 117 | filenameHint = defaultFileStorageName |
| 118 | } |
| 119 | |
| 120 | // Generate the filename |
| 121 | cleanFilename := FileCleanName(filenameHint) |
| 122 | |
| 123 | // If storage is specified (such as a Notebox), get the folder hint from storage. Note |
| 124 | // that if it's the file system, we know that we need to clean it because of the colons, but |
| 125 | // otherwise, let it pass through. |
| 126 | if storageHint != "" { |
| 127 | return fio.CleanName(storageHint) + "/" + cleanFilename |
| 128 | } |
| 129 | |
| 130 | // Return just the clean filename |
| 131 | return cleanFilename |
| 132 | } |
| 133 | |
| 134 | // Combine two components into a filename |
| 135 | func fsConstruct(storage string, filename string) string { |
no test coverage detected