Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
41b4bfdf
Commit
41b4bfdf
authored
Aug 04, 2020
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/new: handle relative paths properly
parent
f5a63be6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
poetry/console/commands/new.py
+13
-4
No files found.
poetry/console/commands/new.py
View file @
41b4bfdf
...
...
@@ -3,8 +3,6 @@ import sys
from
cleo.helpers
import
argument
from
cleo.helpers
import
option
from
poetry.utils.helpers
import
module_name
from
.command
import
Command
...
...
@@ -31,7 +29,11 @@ class NewCommand(Command):
else
:
layout_
=
layout
(
"standard"
)
path
=
Path
.
cwd
()
/
Path
(
self
.
argument
(
"path"
))
path
=
Path
(
self
.
argument
(
"path"
))
if
not
path
.
is_absolute
():
# we do not use resolve here due to compatibility issues for path.resolve(strict=False)
path
=
Path
.
cwd
()
.
joinpath
(
path
)
name
=
self
.
option
(
"name"
)
if
not
name
:
name
=
path
.
name
...
...
@@ -68,8 +70,15 @@ class NewCommand(Command):
)
layout_
.
create
(
path
)
path
=
path
.
resolve
()
try
:
path
=
path
.
relative_to
(
Path
.
cwd
())
except
ValueError
:
pass
self
.
line
(
"Created package <info>{}</> in <fg=blue>{}</>"
.
format
(
module_name
(
name
),
path
.
relative_to
(
Path
.
cwd
())
layout_
.
_package_name
,
path
.
as_posix
()
# noqa
)
)
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