Skip to content

Commit

Permalink
Add the necessary docs into the app binary
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Sep 11, 2020
1 parent 9200b01 commit 1582997
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,46 @@ object CommandAppHelper {
|My Photo Timeline
|
|Version: ${BuildInfo.version}
|Git head: ${BuildInfo.gitHeadCommit.getOrElse("none")}""".stripMargin
|Git head: ${BuildInfo.gitHeadCommit.getOrElse("none")}
|Bug reports: https://github.com/wiringbits/my-photo-timeline/issues
|
|You can collect all your photo directories in a single root directory, and just run the app (--dry-run doesn't alter your file system, it's recommended to try that first):
|- ./my-photo-timeline --source ~/Desktop/test-photos --output ~/Desktop/test-output --dry-run
|
|The `test-photos` directory could look like:
|
|test-photos
|├── img1.jpg
|├── img1-again.jpg
|├── invalid
|│ ├── img2-no-metadata.jpg
|├── img3.jpg
|├── img4.jpg
|├── img5.jpg
|
|Producing the `test-output` directory like:
|
|test-output
|├── duplicated
|│ ├── img1-again.jpg
|├── invalid
|│ ├── img2-no-metadata.jpg
|└── organized
| ├── 2009
| │ └── 03-march
| │ ├── img1.jpg
| ├── 2010
| │ ├── 07-july
| │ │ ├── img3.jpg
| │ │ └── img4.jpg
| │ ├── 09-september
| │ │ ├── img5.jpg
|
|Where:
|- test-output/duplicated has the photos were detected as duplicated.
|- test-output/invalid has the photos (or non-photos) where the app couldn't detect the creation date.
|- test-output/organized has the photos organized by date, the format being `year/month/photo-name`.
|""".stripMargin
}

val sourceOpt: Opts[os.Path] = Opts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ class FileOrganizerTask(logger: SimpleLogger) {
}

logger.info("Done")

if (args.dryRun) {
logger.info("Remember to remove the --dry-run option to actually organize the photos")
} else {
val text =
"""
|I hope you found the app useful.
|
|When I was looking for one, I was willing to pay $100 USD for it but found nothing fulfilling my needs.
|any donations are welcome:
|- Bitcoin: bc1qf37j0wutmn9ngkpn8v7mknukn3f0cmvq3p7dzf
|- Ethereum: 0x02D1f6b4992fD147F19525150b97509D2eaAa651
|- Litecoin: LWYPqEYG6fQdvCWCKWvFygskNTptqxuUHu
|""".stripMargin
logger.info(text)
}
}

private def trackProgress(current: Int, total: Int): Unit = {
Expand All @@ -120,7 +136,7 @@ class FileOrganizerTask(logger: SimpleLogger) {
}

private def exit(msg: String): Unit = {
logger.fatal(s"FATAL: $msg")
logger.fatal(msg)
sys.exit(1)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ class SimpleLogger {

def fatal(msg: String): Unit = {
System.err.println(s"${fansi.Color.Red("FATAL")}: $msg")
System.err.println(
"Please report this problem so that it gets fixed: https://github.com/wiringbits/my-photo-timeline/issues"
)
}
}

0 comments on commit 1582997

Please sign in to comment.