add parsing arguments

This commit is contained in:
Tykayn 2023-06-29 18:59:12 +02:00 committed by tykayn
parent c1750aff07
commit d1645f6744
3 changed files with 13 additions and 14 deletions

View File

@ -21,6 +21,7 @@ import finder from './finder.mjs'
let mini_arguments; let mini_arguments;
console.log(' ') console.log(' ')
function parseArguments () { function parseArguments () {
mini_arguments = minimist(process.argv.slice(2)) mini_arguments = minimist(process.argv.slice(2))
// console.log('arguments', mini_arguments) // console.log('arguments', mini_arguments)
@ -28,8 +29,6 @@ function parseArguments () {
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) { function renameFile (originalFileName, fileMixedNewName) {
fs.rename(originalFileName, fileMixedNewName, function (err) { fs.rename(originalFileName, fileMixedNewName, function (err) {
@ -37,12 +36,6 @@ function renameFile (originalFileName, fileMixedNewName) {
}) })
} }
const fileDefinition = {
dateStamp: '',
freeText: '',
tags: [],
extension: '',
}
function makeFileNameFromProperties (fileProperties) { function makeFileNameFromProperties (fileProperties) {
return finder.cleanSpaces(fileProperties.dateStamp + ' ' + fileProperties.freeText + ' ' + tagSectionSeparator + ' ' + fileProperties.tags.join(tagSeparator) + fileProperties.extension) return finder.cleanSpaces(fileProperties.dateStamp + ' ' + fileProperties.freeText + ' ' + tagSectionSeparator + ' ' + fileProperties.tags.join(tagSeparator) + fileProperties.extension)
@ -58,11 +51,6 @@ function prependFileName (fileProperties, newText) {
return fileProperties return fileProperties
} }
/**
* work in progress
*
*/
// run tests // run tests
if (enableTestsLocally) { if (enableTestsLocally) {

View File

@ -1,6 +1,16 @@
import finder from './finder.mjs' 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() { export function TestScreenShotIsFoundAndRenamed() {
let screenShotMockFileName = 'Screenshot 2023-06-15 at 15-28-21 Instance Panoramax OSM-FR.png' let screenShotMockFileName = 'Screenshot 2023-06-15 at 15-28-21 Instance Panoramax OSM-FR.png'

View File

@ -3,6 +3,7 @@ import fs from 'node-fs'
/** /**
----------------------- parties non réalisées ----------------------- ----------------------- parties non réalisées -----------------------
* work in progress
// TODO // TODO
--------------------------------------------------------------------- ---------------------------------------------------------------------
**/ **/