mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 14:31:30 +03:00
Merge pull request #3603 from Byron/windows-improvements
windows improvements
This commit is contained in:
commit
812b4ea27c
2
.github/workflows/push.yaml
vendored
2
.github/workflows/push.yaml
vendored
@ -225,4 +225,4 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: "cargo check"
|
||||
run: cargo check --all --bins --examples
|
||||
run: cargo check --all --bins --examples --features windows
|
||||
|
@ -70,6 +70,8 @@ correctness = "deny"
|
||||
|
||||
[features]
|
||||
default = ["custom-protocol", "sentry", "devtools"]
|
||||
## A forwarding to all crates that have windows-specific adjustments for testing on non-Windows.
|
||||
windows = ["gitbutler-watcher/windows"]
|
||||
devtools = ["tauri/devtools"]
|
||||
|
||||
# this feature is used used for production builds where `devPath` points to the filesystem
|
||||
|
@ -35,6 +35,7 @@ pub fn init(app_handle: &AppHandle) {
|
||||
.parse()
|
||||
.unwrap_or(LevelFilter::INFO);
|
||||
|
||||
let use_colors_in_logs = cfg!(not(feature = "windows"));
|
||||
let subscriber = tracing_subscriber::registry()
|
||||
.with(
|
||||
// subscriber for https://github.com/tokio-rs/console
|
||||
@ -49,6 +50,7 @@ pub fn init(app_handle: &AppHandle) {
|
||||
// subscriber that writes spans to stdout
|
||||
tracing_subscriber::fmt::layer()
|
||||
.event_format(format_for_humans.clone())
|
||||
.with_ansi(use_colors_in_logs)
|
||||
.with_span_events(FmtSpan::CLOSE)
|
||||
.with_filter(log_level_filter),
|
||||
)
|
||||
|
@ -4,6 +4,11 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = []
|
||||
## A trial to see if doing things differently on Windows helps with #3601
|
||||
windows = []
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
|
@ -12,7 +12,8 @@ use tracing::Level;
|
||||
|
||||
/// The timeout for debouncing file change events.
|
||||
/// This is used to prevent multiple events from being sent for a single file change.
|
||||
const DEBOUNCE_TIMEOUT: Duration = Duration::from_millis(100);
|
||||
const DEBOUNCE_TIMEOUT: Duration =
|
||||
Duration::from_millis(if cfg!(feature = "windows") { 2000 } else { 100 });
|
||||
|
||||
/// This error is required only because `anyhow::Error` isn't implementing `std::error::Error`, and [`spawn()`]
|
||||
/// needs to wrap it into a `backoff::Error` which also has to implement the `Error` trait.
|
||||
@ -44,6 +45,10 @@ pub fn spawn(
|
||||
out: tokio::sync::mpsc::UnboundedSender<InternalEvent>,
|
||||
) -> Result<()> {
|
||||
let (notify_tx, notify_rx) = std::sync::mpsc::channel();
|
||||
tracing::info!(
|
||||
"Starting filesystem monitor on {worktree_path:?} with debounce of {:02}s",
|
||||
DEBOUNCE_TIMEOUT.as_secs_f32()
|
||||
);
|
||||
let mut debouncer =
|
||||
new_debouncer(DEBOUNCE_TIMEOUT, None, notify_tx).context("failed to create debouncer")?;
|
||||
|
||||
|
@ -163,7 +163,11 @@ CONFIG_PATH=$(readlink -f "$PWD/../crates/gitbutler-tauri/tauri.conf.$CHANNEL.js
|
||||
# update the version in the tauri release config
|
||||
jq '.package.version="'"$VERSION"'"' "$CONFIG_PATH" >"$TMP_DIR/tauri.conf.json"
|
||||
|
||||
if [ "$OS" = "windows" ]; then
|
||||
FEATURES="windows"
|
||||
else
|
||||
FEATURES=""
|
||||
fi
|
||||
|
||||
# build the app with release config
|
||||
SENTRY_RELEASE="$VERSION" tauri build \
|
||||
|
Loading…
Reference in New Issue
Block a user