Checks if all specified files are fresher (younger) than a given expiry age
Project description
Installation with UV
uv tool install freshfiles
Sample use-case in bash
Checking the age
# `./update_files.sh` is invoked if any of these files are missing or more than 1 hour old
freshfiles check --max-age-seconds 3600 file1 file2 || ./update_files.sh
freshfiles check --max-age-seconds 3600 .authfile && echo "no auth needed" || {
echo "authenticating" # replace with actual authentication
touch .authfile
}
Checking that target files are more recent that any of the source files used to generate the target
freshfiles compare -s src1 -s src2 -t dest || echo "update dest from src1 and src2"
Using justfiles
Project link: https://just.systems/man/en/introduction.html
[private]
_maybe_authenticate:
#!/usr/bin/env bash
set -euo pipefail
freshfiles check --max-age-seconds 3 .authfile && echo "auth still valid" || {
echo "authenticating" # replace with actual authentication
touch .authfile
}
run: _maybe_authenticate
@echo "... do work with valid auth"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
freshfiles-0.2.0.tar.gz
(4.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file freshfiles-0.2.0.tar.gz.
File metadata
- Download URL: freshfiles-0.2.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
804c30fabd15dc4ddc928ebbdc3d8ba908c57fcb782f7e582c41d3106f2672cb
|
|
| MD5 |
bc662e88696a12b129157ec2eb986f3b
|
|
| BLAKE2b-256 |
9bd36063884188c81f03046168caa7cfc2ce1306f267e7189d766727dd79fe9b
|
File details
Details for the file freshfiles-0.2.0-py3-none-any.whl.
File metadata
- Download URL: freshfiles-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5a47717cb1c5b26e10795037cad05e6b3561f6b5d82cbadfb9a322ec7784b8d
|
|
| MD5 |
7264af5f84799cdc08667898b807a922
|
|
| BLAKE2b-256 |
e7cddd1c9ba14b4eef76093d4f79962d5f9bc851c572ba79d7dca31b3fdea3c3
|