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
c9c06f8a
There was an error fetching the commit references. Please try again later.
Unverified
Commit
c9c06f8a
authored
3 years ago
by
GyDi
Browse files
Options
Downloads
Patches
Plain Diff
fix: wrong exe path
parent
72127979
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src-tauri/Cargo.lock
+7
-0
7 additions, 0 deletions
src-tauri/Cargo.lock
src-tauri/Cargo.toml
+1
-0
1 addition, 0 deletions
src-tauri/Cargo.toml
src-tauri/src/core/verge.rs
+6
-19
6 additions, 19 deletions
src-tauri/src/core/verge.rs
src-tauri/src/utils/resolve.rs
+1
-1
1 addition, 1 deletion
src-tauri/src/utils/resolve.rs
with
15 additions
and
20 deletions
src-tauri/Cargo.lock
+
7
−
0
View file @
c9c06f8a
...
...
@@ -448,6 +448,7 @@ dependencies = [
"auto-launch",
"chrono",
"dirs",
"dunce",
"log",
"log4rs",
"port_scanner",
...
...
@@ -868,6 +869,12 @@ dependencies = [
"dtoa",
]
[[package]]
name = "dunce"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541"
[[package]]
name = "easy-parallel"
version = "3.2.0"
...
...
This diff is collapsed.
Click to expand it.
src-tauri/Cargo.toml
+
1
−
0
View file @
c9c06f8a
...
...
@@ -14,6 +14,7 @@ tauri-build = { version = "1.0.0-rc.3", features = [] }
[dependencies]
dirs
=
"4.0.0"
dunce
=
"1.0.2"
chrono
=
"0.4.19"
serde_json
=
"1.0"
serde_yaml
=
"0.8"
...
...
This diff is collapsed.
Click to expand it.
src-tauri/src/core/verge.rs
+
6
−
19
View file @
c9c06f8a
...
...
@@ -5,7 +5,7 @@ use crate::{
use
auto_launch
::{
AutoLaunch
,
AutoLaunchBuilder
};
use
serde
::{
Deserialize
,
Serialize
};
use
std
::
sync
::
Arc
;
use
tauri
::{
a
pi
::
path
::
resource_dir
,
async_runtime
::
Mutex
};
use
tauri
::{
a
sync_runtime
::
Mutex
,
utils
::
platform
::
current_exe
};
/// ### `verge.yaml` schema
#[derive(Default,
Debug,
Clone,
Deserialize,
Serialize)]
...
...
@@ -122,13 +122,11 @@ impl Verge {
}
/// init the auto launch
pub
fn
init_launch
(
&
mut
self
,
package_info
:
&
tauri
::
PackageInfo
)
{
let
app_name
=
"clash-verge"
;
let
app_path
=
get_app_path
(
app_name
);
let
app_path
=
resource_dir
(
package_info
,
&
tauri
::
Env
::
default
())
.unwrap
()
.join
(
app_path
);
let
app_path
=
app_path
.as_os_str
()
.to_str
()
.unwrap
();
pub
fn
init_launch
(
&
mut
self
)
{
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
();
let
auto
=
AutoLaunchBuilder
::
new
()
.set_app_name
(
app_name
)
...
...
@@ -324,14 +322,3 @@ impl Verge {
});
}
}
// Get the target app_path
fn
get_app_path
(
app_name
:
&
str
)
->
String
{
#[cfg(target_os
=
"linux"
)]
let
ext
=
""
;
#[cfg(target_os
=
"macos"
)]
let
ext
=
""
;
#[cfg(target_os
=
"windows"
)]
let
ext
=
".exe"
;
String
::
from
(
app_name
)
+
ext
}
This diff is collapsed.
Click to expand it.
src-tauri/src/utils/resolve.rs
+
1
−
1
View file @
c9c06f8a
...
...
@@ -31,7 +31,7 @@ pub fn resolve_setup(app: &App) {
}
verge
.init_sysproxy
(
clash
.info.port
.clone
());
verge
.init_launch
(
app
.package_info
()
);
verge
.init_launch
();
if
let
Err
(
err
)
=
verge
.sync_launch
()
{
log
::
error!
(
"{}"
,
err
);
}
...
...
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