Skip to content

Commit

Permalink
🚚 Move website directory inside .orangutan
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Jan 2, 2024
1 parent f15391d commit 914bcaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/orangutan/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ const WEBSITE_DIR_NAME: &'static str = "website";
lazy_static! {
static ref WORK_DIR: PathBuf = env::current_dir().unwrap();
pub static ref WEBSITE_REPOSITORY: String = env::var("WEBSITE_REPOSITORY").expect("Environment variable `WEBSITE_REPOSITORY` is required.");
pub static ref WEBSITE_ROOT_PATH: String = env::var("WEBSITE_ROOT").unwrap_or("website".to_string());
pub static ref WEBSITE_ROOT: &'static Path = Path::new(WEBSITE_ROOT_PATH.as_str());
pub static ref BASE_DIR: PathBuf = WORK_DIR.join(".orangutan");
pub static ref WEBSITE_ROOT: PathBuf = BASE_DIR.join("website");
pub static ref KEYS_DIR: PathBuf = BASE_DIR.join("keys");
pub static ref HUGO_CONFIG_DIR: PathBuf = BASE_DIR.join("hugo-config");
pub static ref DEST_DIR: PathBuf = BASE_DIR.join("out");
Expand Down
8 changes: 4 additions & 4 deletions src/orangutan/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn clone_repository() -> Result<(), Error> {
fn _clone_repository() -> Result<(), Error> {
let mut command = Command::new("git");
command
.args(vec!["clone", &WEBSITE_REPOSITORY, &WEBSITE_ROOT_PATH])
.args(vec!["clone", &WEBSITE_REPOSITORY, &WEBSITE_ROOT.display().to_string()])
.args(vec!["--depth", "1"]);

trace!("Running `{:?}`…", command);
Expand All @@ -66,7 +66,7 @@ fn _clone_repository() -> Result<(), Error> {
fn _init_submodules() -> Result<(), Error> {
let mut command = Command::new("git");
command
.args(vec!["-C", &WEBSITE_ROOT_PATH])
.args(vec!["-C", &WEBSITE_ROOT.display().to_string()])
.args(vec!["submodule", "update", "--init"]);

trace!("Running `{:?}`…", command);
Expand All @@ -90,7 +90,7 @@ pub fn pull_repository() -> Result<(), Error> {
fn _pull_repository() -> Result<(), Error> {
let mut command = Command::new("git");
command
.args(vec!["-C", &WEBSITE_ROOT_PATH])
.args(vec!["-C", &WEBSITE_ROOT.display().to_string()])
.arg("pull");

trace!("Running `{:?}`…", command);
Expand All @@ -108,7 +108,7 @@ fn _pull_repository() -> Result<(), Error> {
fn _update_submodules() -> Result<(), Error> {
let mut command = Command::new("git");
command
.args(vec!["-C", &WEBSITE_ROOT_PATH])
.args(vec!["-C", &WEBSITE_ROOT.display().to_string()])
.args(vec!["submodule", "update", "--remote", "--recursive"]);

trace!("Running `{:?}`…", command);
Expand Down

0 comments on commit 914bcaa

Please sign in to comment.