Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git_borg_linker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
git_borg_linker
Commits
25f5655e
Commit
25f5655e
authored
3 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/commit.rs: add check_path function
parent
ff3036b9
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
src/commit.rs
+14
-2
14 additions, 2 deletions
src/commit.rs
with
14 additions
and
2 deletions
src/commit.rs
+
14
−
2
View file @
25f5655e
use
crate
::
init
;
use
std
::
process
::{
exit
,
Command
};
use
std
::{
process
::{
exit
,
Command
},
path
::
PathBuf
};
/// Check if .borg repository and results folder exists
pub
fn
check_path
()
->
(
PathBuf
,
PathBuf
)
{
let
(
borg_folder
,
results_folder
)
=
init
::
get_borg_folder
();
if
!
borg_folder
.is_dir
()
{
eprintln!
(
"{} folder not found !"
,
borg_folder
.to_str
()
.unwrap
());
exit
(
2
)
}
(
borg_folder
,
results_folder
)
}
/// Get the current commit name of a git repository
///
...
...
@@ -26,7 +38,7 @@ pub fn get_current_commit() -> String {
/// Create a commit of the results folder named as the current git commit id
pub
fn
commit
(
compression
:
String
)
{
let
(
borg_folder
,
results_folder
)
=
init
::
get_borg_folder
();
let
(
borg_folder
,
results_folder
)
=
check_path
();
let
commit
=
get_current_commit
();
let
output
=
Command
::
new
(
"borg"
)
.arg
(
"create"
)
...
...
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