|Philipp Häfelfinger c1ad9c9a22||7 months ago|
|cmd/SideCarJpegCleaner||7 months ago|
|configs||7 months ago|
|internal/app||7 months ago|
|.gitignore||8 months ago|
|LICENSE||1 year ago|
|README.md||1 year ago|
|go.mod||1 year ago|
|go.sum||1 year ago|
A small tool to clean up a folder with raw and jpeg files. It scans the directory for jpg files and removes all without a corresponding raw file.
There are some external dependencies to build the application.
To get the latest version, you should
git clone https://git.haefelfinger.net/piwigo/SideCarJpegCleaner.git to
your local disk or into your local go source directory by using ``go get git.haefelfinger.net/piwigo/SideCarJpegCleaner`.
The repository supports gomodules so the modules should be resolved automatically during build or test run. But just in case, here are the manual commands to install them. This is needed if you put this repo inside the GOPATH as this sets the module config to ignore.
To get all dependencies at once:
go get ./...
You may install the dependencies manually with the following commands or just use the command under "GO modules" to get all dependencies.
go get github.com/sirupsen/logrus go get github.com/vharitonsky/iniflags
Build the main executable by using the following command. By default it gets the name SideCarJpegCleaner but can be renamed to your favorite application name.
go build cmd/SideCarJpegCleaner/SideCarJpegCleaner.go
You get the following help information to the command line by using:
The following options are supported to run the application from the command line.
Usage of ./SideCarJpegCleaner: -allowMissingConfig Don't terminate the app if the ini file cannot be read. -allowUnknownFlags Don't terminate the app if ini file contains unknown flags. -config string Path to ini config for using in go flags. May be relative to the current executable path. -configUpdateInterval duration Update interval for re-reading config file set via -config flag. Zero disables config file re-reading. -dryRun If set to true, all actions are run except the real filesystem modifications (default true) -dumpflags Dumps values for all flags defined in the app into stdout in ini-compatible syntax and terminates the app. -imagesRootPath string This is the images root path that should be cleaned. -logLevel string The minimum log level required to write out a log message. (panic,fatal,error,warn,info,debug,trace) (default "info")
It is also possible to use a configuration file to save the settings to be used with multiple directories. To use configuration files, just copy the default one and edit the parameters to your wish.
cp ./configs/defaultConfig.ini ./localConfig.ini nano ./localConfig.ini
Finally you may run the application using the following example command.
It is recommendet to do a dry run first!