From d1645f6744855180e2be445c68ee81f315be4379 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 29 Jun 2023 18:59:12 +0200 Subject: [PATCH] add parsing arguments --- rangement/index.mjs | 14 +------------- rangement/testFunctions.mjs | 10 ++++++++++ rangement/workInProgress/not_ready_functions.mjs | 3 ++- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/rangement/index.mjs b/rangement/index.mjs index 81f030e5..2ee2af1c 100644 --- a/rangement/index.mjs +++ b/rangement/index.mjs @@ -21,6 +21,7 @@ import finder from './finder.mjs' let mini_arguments; console.log(' ') + function parseArguments () { mini_arguments = minimist(process.argv.slice(2)) // console.log('arguments', mini_arguments) @@ -28,8 +29,6 @@ function parseArguments () { parseArguments() -const pathFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher/tout' -const sortingFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher' function renameFile (originalFileName, fileMixedNewName) { fs.rename(originalFileName, fileMixedNewName, function (err) { @@ -37,12 +36,6 @@ function renameFile (originalFileName, fileMixedNewName) { }) } -const fileDefinition = { - dateStamp: '', - freeText: '', - tags: [], - extension: '', -} function makeFileNameFromProperties (fileProperties) { return finder.cleanSpaces(fileProperties.dateStamp + ' ' + fileProperties.freeText + ' ' + tagSectionSeparator + ' ' + fileProperties.tags.join(tagSeparator) + fileProperties.extension) @@ -58,11 +51,6 @@ function prependFileName (fileProperties, newText) { return fileProperties } -/** - * work in progress - * - */ - // run tests if (enableTestsLocally) { diff --git a/rangement/testFunctions.mjs b/rangement/testFunctions.mjs index f8626708..548b4dd7 100644 --- a/rangement/testFunctions.mjs +++ b/rangement/testFunctions.mjs @@ -1,6 +1,16 @@ import finder from './finder.mjs' +const pathFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher/tout' +const sortingFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher' + +const fileDefinition = { + dateStamp: '', + freeText: '', + tags: [], + extension: '', +} + export function TestScreenShotIsFoundAndRenamed() { let screenShotMockFileName = 'Screenshot 2023-06-15 at 15-28-21 Instance Panoramax OSM-FR.png' diff --git a/rangement/workInProgress/not_ready_functions.mjs b/rangement/workInProgress/not_ready_functions.mjs index 8078ec90..fd67409b 100644 --- a/rangement/workInProgress/not_ready_functions.mjs +++ b/rangement/workInProgress/not_ready_functions.mjs @@ -3,7 +3,8 @@ import fs from 'node-fs' /** ----------------------- parties non réalisées ----------------------- - // TODO + * work in progress +// TODO --------------------------------------------------------------------- **/