add parsing arguments
This commit is contained in:
parent
c1750aff07
commit
d1645f6744
|
@ -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) {
|
||||||
|
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -3,7 +3,8 @@ import fs from 'node-fs'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
----------------------- parties non réalisées -----------------------
|
----------------------- parties non réalisées -----------------------
|
||||||
// TODO
|
* work in progress
|
||||||
|
// TODO
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue