Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Clash Verge
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Clash Verge
Commits
2d95f2b0
There was an error fetching the commit references. Please try again later.
Unverified
Commit
2d95f2b0
authored
3 years ago
by
GyDi
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: auto launch path
parent
ec41bb9c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src-tauri/src/core/verge.rs
+13
-19
13 additions, 19 deletions
src-tauri/src/core/verge.rs
src-tauri/src/utils/resolve.rs
+1
-2
1 addition, 2 deletions
src-tauri/src/utils/resolve.rs
with
14 additions
and
21 deletions
src-tauri/src/core/verge.rs
+
13
−
19
View file @
2d95f2b0
...
...
@@ -133,37 +133,31 @@ impl Verge {
}
/// init the auto launch
pub
fn
init_launch
(
&
mut
self
)
{
pub
fn
init_launch
(
&
mut
self
)
->
Result
<
()
>
{
let
app_exe
=
current_exe
()
.unwrap
();
let
app_exe
=
dunce
::
canonicalize
(
app_exe
)
.unwrap
();
let
app_name
=
app_exe
.file_stem
()
.unwrap
()
.to_str
()
.unwrap
();
let
app_path
=
app_exe
.as_os_str
()
.to_str
()
.unwrap
();
// fix issue #26
#[cfg(target_os
=
"windows"
)]
let
app_path
=
format!
(
"
\"
{app_path}
\"
"
);
#[cfg(target_os
=
"windows"
)]
let
app_path
=
app_path
.as_str
();
let
auto
=
AutoLaunchBuilder
::
new
()
.set_app_name
(
app_name
)
.set_app_path
(
app_path
)
.build
();
self
.auto_launch
=
Some
(
auto
);
}
/// sync the startup when run the app
pub
fn
sync_launch
(
&
self
)
->
Result
<
()
>
{
let
enable
=
self
.config.enable_auto_launch
.clone
()
.unwrap_or
(
false
);
if
!
enable
{
return
Ok
(());
}
if
self
.auto_launch
.is_none
()
{
bail!
(
"should init the auto launch first"
);
if
let
Some
(
enable
)
=
self
.config.enable_auto_launch
.as_ref
()
{
// fix issue #26
if
*
enable
{
auto
.enable
()
?
;
}
}
let
auto_launch
=
self
.auto_launch
.clone
()
.unwrap
();
let
is_enabled
=
auto_launch
.is_enabled
()
.unwrap_or
(
false
);
if
!
is_enabled
{
auto_launch
.enable
()
?
;
}
self
.auto_launch
=
Some
(
auto
);
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
src-tauri/src/utils/resolve.rs
+
1
−
2
View file @
2d95f2b0
...
...
@@ -38,8 +38,7 @@ pub fn resolve_setup(app: &App) {
clash
.tun_mode
(
true
)
.unwrap
();
}
verge
.init_launch
();
log_if_err!
(
verge
.sync_launch
());
log_if_err!
(
verge
.init_launch
());
}
/// reset system proxy
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment