Crates.io | neocities-sync |
lib.rs | neocities-sync |
version | 1.0.0 |
source | src |
created_at | 2024-06-25 09:39:18.956151 |
updated_at | 2024-06-25 09:39:18.956151 |
description | Sync files to neocities while doing the least amount of API requests. |
homepage | https://github.com/aspizu/neocities-sync |
repository | https://github.com/aspizu/neocities-sync |
max_upload_size | |
id | 1283161 |
size | 92,812 |
neocities-sync
Sync files to neocities while doing the least amount of API requests.
You can use this to deploy a Vite, Astro or Next.js app to neocities.
neocities-sync
will:
.state
file..state
file doesn't exist, it will fetch all file hashes from neocities and store them in the .state
file.--ignore-disallowed-file-types
is set, it will ignore disallowed file types. Use this if you are NOT a supporter.cargo install neocities-sync
❯ neocities-sync --help
|\---/|
| x_x | neocities-sync
\_-_/
Sync files to neocities while doing the least amount of API requests.
Usage: neocities-sync <COMMAND>
Commands:
login Login to neocities
logout Logout from neocities
sync Sync a directory to neocities
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
❯ neocities-sync sync --help
Sync a directory to neocities
Usage: neocities-sync sync [OPTIONS] [PATH]
Arguments:
[PATH] The directory to sync [default: .]
Options:
-s, --state <STATE> Path to the state file. Used to keep track of the last sync
-i, --ignore-disallowed-file-types Use this if you are NOT a supporter
-h, --help Print help
Run your build command. Given that your build output is in the dist
directory,
we can use neocities-sync
to upload the files to neocities.
First login using the neocities-sync login
command. It will prompt you for your
username and password (Will not be displayed in the terminal)
❯ neocities-sync dist --ignore-disallowed-file-types --state .state
Here, we use --state .state
to store the state outside the dist
directory because
it will be emptied on every build.
Now, every time you make changes to your app, re-run the build command and then run the
neocities-sync
command. It will only upload the files that have been modified.
Pull requests are welcome.