add dev script

This commit is contained in:
Tykayn 2023-07-19 10:57:07 +02:00 committed by tykayn
parent 51731aad08
commit 217d9de761
3 changed files with 21 additions and 1 deletions

12
development.sh Normal file
View File

@ -0,0 +1,12 @@
#/bin/bash
#
# -------------------------
# this should work for dev purposes
# alias should be set in you bash aliases files:
#
# alias range="node /home/poule/encrypted/stockage-syncable/www/development/html/rangement/index.mjs --dry-run=true "
# -------------------------
range /home/poule/encrypted/stockage-syncable/www/development/html/rangement/testFiles/misnamed_file/2000-01-01T01.01.01\ FyB8cZnWIAc21rw\ --\ meme.jpg
# you should see that the debug logs find a misnamed file name
# and want to rename it to the 2023 date of modification, not the 2000 year date.

View File

@ -54,6 +54,13 @@ describe('modification in file name', () => {
)
.toBe('mon texte ajouté à la fin du texte libre')
})
test('should prepend to file name in the right place', () => {
let modifiedProperties = finder.prependFileName(properties, 'ajouté au début du texte libre ')
expect(
modifiedProperties.freeText
)
.toBe('ajouté au début du texte libre mon texte')
})
test('should replace text in file name', () => {
let searchString = 'vacances', replaceString = 'machin'
let replacedString = finder.searchAndReplaceInFileName(searchString, replaceString, fileNameOriginal)

View File

@ -220,6 +220,7 @@ export default class finder {
* @returns {string}
*/
static findEarliestDateInExifData (exifData) {
log.debug(' finder - findEarliestDateInExifData')
if (exifData) {
let moments = []
@ -263,7 +264,7 @@ export default class finder {
return minDate.format(rangement_instance.iso_date_format)
} else {
log.debug(' finder - pas de exif data')
log.debug(' finder - /!\\ pas de exif data')
return ''
}
}