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
a3e7626d
There was an error fetching the commit references. Please try again later.
Unverified
Commit
a3e7626d
authored
3 years ago
by
GyDi
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: add dev feature
parent
5cb5d74e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src-tauri/Cargo.toml
+1
-0
1 addition, 0 deletions
src-tauri/Cargo.toml
src-tauri/src/utils/dirs.rs
+11
-6
11 additions, 6 deletions
src-tauri/src/utils/dirs.rs
src-tauri/src/utils/server.rs
+3
-0
3 additions, 0 deletions
src-tauri/src/utils/server.rs
with
15 additions
and
6 deletions
src-tauri/Cargo.toml
+
1
−
0
View file @
a3e7626d
...
...
@@ -40,3 +40,4 @@ winreg = { version = "0.10", features = ["transactions"] }
[features]
default
=
[
"custom-protocol"
]
custom-protocol
=
[
"tauri/custom-protocol"
]
verge-dev
=
[]
This diff is collapsed.
Click to expand it.
src-tauri/src/utils/dirs.rs
+
11
−
6
View file @
a3e7626d
...
...
@@ -5,12 +5,22 @@ use tauri::{
Env
,
PackageInfo
,
};
#[cfg(not(feature
=
"verge-dev"
))]
static
APP_DIR
:
&
str
=
"clash-verge"
;
#[cfg(feature
=
"verge-dev"
)]
static
APP_DIR
:
&
str
=
"clash-verge-dev"
;
static
CLASH_CONFIG
:
&
str
=
"config.yaml"
;
static
VERGE_CONFIG
:
&
str
=
"verge.yaml"
;
static
PROFILE_YAML
:
&
str
=
"profiles.yaml"
;
static
PROFILE_TEMP
:
&
str
=
"clash-verge-runtime.yaml"
;
/// get the verge app home dir
pub
fn
app_home_dir
()
->
PathBuf
{
home_dir
()
.unwrap
()
.join
(
Path
::
new
(
".config"
))
.join
(
Path
::
new
(
"clash-verge"
))
.join
(
Path
::
new
(
APP_DIR
))
}
/// get the resources dir
...
...
@@ -30,11 +40,6 @@ pub fn app_logs_dir() -> PathBuf {
app_home_dir
()
.join
(
"logs"
)
}
static
CLASH_CONFIG
:
&
str
=
"config.yaml"
;
static
VERGE_CONFIG
:
&
str
=
"verge.yaml"
;
static
PROFILE_YAML
:
&
str
=
"profiles.yaml"
;
static
PROFILE_TEMP
:
&
str
=
"clash-verge-runtime.yaml"
;
pub
fn
clash_path
()
->
PathBuf
{
app_home_dir
()
.join
(
CLASH_CONFIG
)
}
...
...
This diff is collapsed.
Click to expand it.
src-tauri/src/utils/server.rs
+
3
−
0
View file @
a3e7626d
...
...
@@ -4,7 +4,10 @@ use port_scanner::local_port_available;
use
tauri
::{
AppHandle
,
Manager
};
use
warp
::
Filter
;
#[cfg(not(feature
=
"verge-dev"
))]
const
SERVER_PORT
:
u16
=
33333
;
#[cfg(feature
=
"verge-dev"
)]
const
SERVER_PORT
:
u16
=
11233
;
/// check whether there is already exists
pub
fn
check_singleton
()
->
Result
<
(),
()
>
{
...
...
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