mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
feat(registry): add DATA_DIR variable
This commit is contained in:
parent
237d6e67e3
commit
32d5f8c517
3 changed files with 9 additions and 3 deletions
|
@ -113,6 +113,10 @@ for this purpose.
|
|||
index repository.\
|
||||
Example: `pesde@localhost`
|
||||
|
||||
- **DATA_DIR**: The directory where the registry stores miscellaneous data.
|
||||
This value can use `{CWD}` to refer to the current working directory.\
|
||||
Default: `{CWD}/data`
|
||||
|
||||
- **ADDRESS**: The address to bind the server to.\
|
||||
Default: `127.0.0.1`
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ GIT_PASSWORD= # password of the account (PAT for GitHub)
|
|||
COMMITTER_GIT_NAME= # name of the committer used for index updates
|
||||
COMMITTER_GIT_EMAIL= # email of the committer used for index updates
|
||||
|
||||
DATA_DIR= # directory where miscellaneous data is stored
|
||||
|
||||
# AUTHENTICATION CONFIGURATION
|
||||
# Set the variables of the authentication you want to use in order to enable it
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ async fn run() -> std::io::Result<()> {
|
|||
let port: u16 = benv!(parse "PORT" => "8080");
|
||||
|
||||
let cwd = current_dir().unwrap();
|
||||
let data_dir = cwd.join("data");
|
||||
let data_dir = PathBuf::from(benv!("DATA_DIR" => "{CWD}/data").replace("{CWD}", cwd.to_str().unwrap()));
|
||||
fs_err::create_dir_all(&data_dir).unwrap();
|
||||
|
||||
let project = Project::new(
|
||||
|
|
Loading…
Reference in a new issue