up deps folder listing node
This commit is contained in:
parent
975850a7e1
commit
9442153b32
@ -1,25 +1,25 @@
|
||||
// lister les dossiers dans le dossier stockage syncable pour en tirer une liste de dates d'évènements
|
||||
import fs from 'fs';
|
||||
import fs from 'fs'
|
||||
|
||||
let suffix = ''
|
||||
const folder_photo = `/home/poule/encrypted/stockage-syncable/photos${suffix}`;
|
||||
const folder_photo = `/home/poule/encrypted/stockage-syncable/photos${suffix}`
|
||||
|
||||
/**
|
||||
* obtenir une liste des dossiers uniquement dans le dossier courant
|
||||
* @param path
|
||||
* @returns {*}
|
||||
*/
|
||||
function getDirectories(path) {
|
||||
function getDirectories (path) {
|
||||
return fs.readdirSync(path).filter(function (file) {
|
||||
return fs.statSync(path + '/' + file).isDirectory();
|
||||
});
|
||||
return fs.statSync(path + '/' + file).isDirectory()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* lister 3 sous niveaux de dossiers
|
||||
* @param folders
|
||||
*/
|
||||
function recursiveListing(folders){
|
||||
function recursiveListing (folders) {
|
||||
|
||||
for (let dossier of folders) {
|
||||
|
||||
@ -30,13 +30,21 @@ function recursiveListing(folders){
|
||||
if (listing.length) {
|
||||
// console.log('', listing)
|
||||
for (let d2 of listing) {
|
||||
let subdir2 = folder_photo + '/' + dossier+'/'+d2
|
||||
let subdir2 = folder_photo + '/' + dossier + '/' + d2
|
||||
console.log(subdir2)
|
||||
let listing2 = getDirectories(subdir1)
|
||||
if (listing2.length) {
|
||||
for (let d3 of listing2) {
|
||||
let subdir3 = subdir2 +'/'+d3
|
||||
let subdir3 = subdir2 + '/' + d3
|
||||
console.log(subdir3)
|
||||
|
||||
let listing3 = getDirectories(subdir2)
|
||||
if (listing3.length) {
|
||||
for (let d4 of listing3) {
|
||||
let subdir4 = subdir3 + '/' + d4
|
||||
console.log(subdir4)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
14
package-lock.json
generated
14
package-lock.json
generated
@ -7,6 +7,7 @@
|
||||
"name": "scripts-tykayn",
|
||||
"dependencies": {
|
||||
"exifr": "^7.1.3",
|
||||
"minimist": "^1.2.8",
|
||||
"moment": "^2.29.4",
|
||||
"node-fs": "^0.1.7"
|
||||
},
|
||||
@ -4444,6 +4445,14 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.29.4",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
||||
@ -8767,6 +8776,11 @@
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.29.4",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
||||
|
@ -2,6 +2,7 @@
|
||||
"name": "scripts-tykayn",
|
||||
"dependencies": {
|
||||
"exifr": "^7.1.3",
|
||||
"minimist": "^1.2.8",
|
||||
"moment": "^2.29.4",
|
||||
"node-fs": "^0.1.7"
|
||||
},
|
||||
@ -16,6 +17,7 @@
|
||||
"ts-node": "^10.9.1"
|
||||
},
|
||||
"scripts": {
|
||||
"devine": "node rangement/index.mjs",
|
||||
"test": "jest"
|
||||
}
|
||||
}
|
||||
|
8
rangement/.idea/.gitignore
generated
vendored
Normal file
8
rangement/.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
6
rangement/.idea/misc.xml
generated
Normal file
6
rangement/.idea/misc.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
8
rangement/.idea/modules.xml
generated
Normal file
8
rangement/.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/rangement.iml" filepath="$PROJECT_DIR$/.idea/rangement.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
8
rangement/.idea/rangement.iml
generated
Normal file
8
rangement/.idea/rangement.iml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6
rangement/.idea/vcs.xml
generated
Normal file
6
rangement/.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
Loading…
Reference in New Issue
Block a user