mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-08-17 00:00:31 +03:00
automatically create gitbutler-ui/build
This commit is contained in:
parent
612645cfd1
commit
73faf32b29
4
.github/actions/init-env-rust/action.yaml
vendored
4
.github/actions/init-env-rust/action.yaml
vendored
@ -10,10 +10,6 @@ runs:
|
||||
prefix-key: gitbutler-client
|
||||
shared-key: rust
|
||||
|
||||
- name: Placeholder for ui assets
|
||||
shell: bash
|
||||
run: mkdir gitbutler-ui/build
|
||||
|
||||
- name: Check versions
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -1,3 +1,23 @@
|
||||
fn main() {
|
||||
// Make the UI build directory if it doesn't already exist.
|
||||
// We do this here because the tauri context macro expects it to
|
||||
// exist at build time, and it's otherwise manually required to create
|
||||
// it before building.
|
||||
let manifest_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
assert_eq!(manifest_dir.file_name().unwrap(), "gitbutler-app");
|
||||
let build_dir = manifest_dir.parent().unwrap().join("gitbutler-ui/build");
|
||||
if !build_dir.exists() {
|
||||
// NOTE(qix-): Do not use `create_dir_all` here - the parent directory
|
||||
// NOTE(qix-): already exists, and we want to fail if not (for some reason).
|
||||
#[allow(clippy::expect_fun_call, clippy::create_dir)]
|
||||
std::fs::create_dir(&build_dir).expect(
|
||||
format!(
|
||||
"failed to create gitbutler-ui build directory: {:?}",
|
||||
build_dir
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
}
|
||||
|
||||
tauri_build::build();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user