Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GPM - NTNU Git Profile Manager
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
Leo
GPM - NTNU Git Profile Manager
Commits
d82b7df5
Commit
d82b7df5
authored
9 months ago
by
Leo
Browse files
Options
Downloads
Patches
Plain Diff
fix: make sure to write to profiles.json before reading
parent
f9750937
Branches
main
No related tags found
No related merge requests found
Pipeline
#291680
passed
9 months ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
gpm/cli.py
+6
-5
6 additions, 5 deletions
gpm/cli.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
7 additions
and
6 deletions
gpm/cli.py
+
6
−
5
View file @
d82b7df5
...
@@ -19,7 +19,7 @@ Commands:
...
@@ -19,7 +19,7 @@ Commands:
current Manage the current profile
current Manage the current profile
"""
"""
__VERSION__
=
"
0.1.
1
"
__VERSION__
=
"
0.1.
2
"
__AUTHOR__
=
"
Leo <alingval@stud.ntnu.no>
"
__AUTHOR__
=
"
Leo <alingval@stud.ntnu.no>
"
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
...
@@ -152,6 +152,8 @@ class GPM:
...
@@ -152,6 +152,8 @@ class GPM:
:param use_global_git_config: Whether to use the global git config or not, when initializing the class
:param use_global_git_config: Whether to use the global git config or not, when initializing the class
"""
"""
self
.
profiles
=
[]
self
.
profiles
=
[]
self
.
parser
=
setup
()
self
.
_load
()
# Load profiles from file `data_file`
self
.
_load
()
# Load profiles from file `data_file`
self
.
use_global_git_config
=
use_global_git_config
self
.
use_global_git_config
=
use_global_git_config
...
@@ -482,8 +484,7 @@ class GPM:
...
@@ -482,8 +484,7 @@ class GPM:
Run the Git Profile Manager
Run the Git Profile Manager
:return: None
:return: None
"""
"""
parser
=
setup
()
args
=
self
.
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
command
==
'
add
'
:
if
args
.
command
==
'
add
'
:
self
.
add
(
args
.
name
,
args
.
email
,
args
.
comment
)
self
.
add
(
args
.
name
,
args
.
email
,
args
.
comment
)
...
@@ -503,7 +504,7 @@ class GPM:
...
@@ -503,7 +504,7 @@ class GPM:
elif
args
.
current_command
==
'
remove
'
:
elif
args
.
current_command
==
'
remove
'
:
self
.
current_remove
()
self
.
current_remove
()
else
:
else
:
parser
.
print_help
()
self
.
parser
.
print_help
()
elif
args
.
command
==
'
import
'
:
elif
args
.
command
==
'
import
'
:
if
getattr
(
args
,
'
global
'
):
if
getattr
(
args
,
'
global
'
):
self
.
use_global_git_config
=
True
self
.
use_global_git_config
=
True
...
@@ -511,7 +512,7 @@ class GPM:
...
@@ -511,7 +512,7 @@ class GPM:
elif
args
.
author
:
elif
args
.
author
:
print
(
__AUTHOR__
)
print
(
__AUTHOR__
)
else
:
else
:
parser
.
print_help
()
self
.
parser
.
print_help
()
def
main
():
def
main
():
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
d82b7df5
[tool.poetry]
[tool.poetry]
name
=
"gpm"
name
=
"gpm"
version
=
"0.1.
1
"
version
=
"0.1.
2
"
description
=
"Git Profile Management CLI"
description
=
"Git Profile Management CLI"
authors
=
[
"Leo <alingval@stud.ntnu.no>"
]
authors
=
[
"Leo <alingval@stud.ntnu.no>"
]
license
=
"MIT"
license
=
"MIT"
...
...
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