Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
98456673
Verified
Commit
98456673
authored
5 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
fix backup path
parent
adefcf59
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils.py
+4
-4
4 additions, 4 deletions
utils.py
with
4 additions
and
4 deletions
utils.py
+
4
−
4
View file @
98456673
...
@@ -279,9 +279,9 @@ def run_commands(cmds: list):
...
@@ -279,9 +279,9 @@ def run_commands(cmds: list):
if
(
if
(
cmd
.
get
(
"
backup
"
)
and
cmd
.
get
(
"
backup
"
)
and
Path
(
cmd
[
"
target
"
]).
exists
()
and
Path
(
cmd
[
"
target
"
]).
exists
()
and
not
Path
(
cmd
[
"
target
"
]
,
"
.back
"
).
exists
()
not
Path
(
cmd
[
"
target
"
]
+
"
.back
"
).
exists
()
):
):
Path
(
cmd
[
"
target
"
]).
rename
(
Path
(
cmd
[
"
target
"
]
,
"
.back
"
))
Path
(
cmd
[
"
target
"
]).
rename
(
Path
(
cmd
[
"
target
"
]
+
"
.back
"
))
log
(
"
A backup file has been created for:
\n
%s
"
%
cmd
[
"
target
"
])
log
(
"
A backup file has been created for:
\n
%s
"
%
cmd
[
"
target
"
])
# Load content from template if any
# Load content from template if any
content
=
cmd
.
get
(
"
content
"
,
""
)
content
=
cmd
.
get
(
"
content
"
,
""
)
...
@@ -302,8 +302,8 @@ def run_commands(cmds: list):
...
@@ -302,8 +302,8 @@ def run_commands(cmds: list):
elif
cmd
[
"
line
"
]
==
"
backup
"
:
elif
cmd
[
"
line
"
]
==
"
backup
"
:
if
not
cmd
.
get
(
"
target
"
):
if
not
cmd
.
get
(
"
target
"
):
raise
Exception
(
"
No target file to backup.
"
)
raise
Exception
(
"
No target file to backup.
"
)
if
not
Path
(
cmd
[
"
target
"
]
,
"
.back
"
).
exists
():
if
not
Path
(
cmd
[
"
target
"
]
+
"
.back
"
).
exists
():
Path
(
cmd
[
"
target
"
]).
rename
(
Path
(
cmd
[
"
target
"
]
,
"
.back
"
))
Path
(
cmd
[
"
target
"
]).
rename
(
Path
(
cmd
[
"
target
"
]
+
"
.back
"
))
log
(
"
A backup file has been created for:
\n
%s
"
%
cmd
[
"
target
"
])
log
(
"
A backup file has been created for:
\n
%s
"
%
cmd
[
"
target
"
])
else
:
else
:
log
(
"
A backup file already exist for:
\n
%s
"
%
cmd
[
"
target
"
])
log
(
"
A backup file already exist for:
\n
%s
"
%
cmd
[
"
target
"
])
...
...
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