Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-unified-theme-switcher
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-unified-theme-switcher
Commits
34908761
You need to sign in or sign up before continuing.
Commit
34908761
authored
Dec 13, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hotfix: create_config: if system config exists, copy it to home
parent
64736aa5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
utils.py
src/utils.py
+7
-2
No files found.
src/utils.py
View file @
34908761
import
sys
,
os
,
re
import
sys
,
os
,
shutil
,
re
import
subprocess
import
subprocess
import
functools
import
functools
...
@@ -22,9 +22,14 @@ def create_config():
...
@@ -22,9 +22,14 @@ def create_config():
try
:
try
:
if
os
.
geteuid
()
==
0
:
if
os
.
geteuid
()
==
0
:
os
.
makedirs
(
SYSTEM_CONFIG_DIR
,
exist_ok
=
True
)
os
.
makedirs
(
SYSTEM_CONFIG_DIR
,
exist_ok
=
True
)
open
(
SYSTEM_CONFIG_FILE
,
'a'
)
.
close
()
with
open
(
SYSTEM_CONFIG_FILE
,
'a'
):
pass
return
SYSTEM_CONFIG_FILE
return
SYSTEM_CONFIG_FILE
else
:
else
:
if
os
.
path
.
exists
(
SYSTEM_CONFIG_FILE
):
os
.
makedirs
(
HOME_CONFIG_DIR
,
exist_ok
=
True
)
shutil
.
copyfile
(
SYSTEM_CONFIG_FILE
,
HOME_CONFIG_FILE
)
else
:
os
.
makedirs
(
HOME_CONFIG_DIR
,
exist_ok
=
True
)
os
.
makedirs
(
HOME_CONFIG_DIR
,
exist_ok
=
True
)
open
(
HOME_CONFIG_FILE
,
'a'
)
.
close
()
open
(
HOME_CONFIG_FILE
,
'a'
)
.
close
()
return
HOME_CONFIG_FILE
return
HOME_CONFIG_FILE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment