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
3e3fd16a
Unverified
Commit
3e3fd16a
authored
Oct 18, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve get-poetry.py installer
parent
515d827d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
get-poetry.py
+15
-9
No files found.
get-poetry.py
View file @
3e3fd16a
...
...
@@ -205,7 +205,7 @@ if __name__ == "__main__":
main()
"""
BAT
=
"@echo off
\r\n
python
%
USERPROFILE
%
/.poetry/bin/poetry
%*
\r\n
"
BAT
=
"@echo off
\r\n
python
{poetry_bin}
%*
\r\n
"
PRE_MESSAGE
=
"""# Welcome to {poetry}!
...
...
@@ -571,10 +571,15 @@ class Installer:
if
not
os
.
path
.
exists
(
POETRY_BIN
):
os
.
mkdir
(
POETRY_BIN
,
0
o755
)
ext
=
""
if
WINDOWS
:
with
open
(
os
.
path
.
join
(
POETRY_BIN
,
"poetry.bat"
),
"w"
)
as
f
:
f
.
write
(
BAT
)
f
.
write
(
BAT
.
format
(
poetry_bin
=
os
.
path
.
join
(
POETRY_BIN
,
"poetry"
)
.
replace
(
os
.
environ
[
"USERPROFILE"
],
"
%
USERPROFILE
%
"
)
)
)
with
open
(
os
.
path
.
join
(
POETRY_BIN
,
"poetry"
),
"w"
)
as
f
:
f
.
write
(
BIN
)
...
...
@@ -746,14 +751,15 @@ class Installer:
print
(
PRE_MESSAGE
.
format
(
**
kwargs
))
def
display_pre_uninstall_message
(
self
):
home_bin
=
POETRY_BIN
if
WINDOWS
:
home_bin
=
home_bin
.
replace
(
os
.
getenv
(
"USERPROFILE"
,
""
),
"
%
USERPROFILE
%
"
)
else
:
home_bin
=
home_bin
.
replace
(
os
.
getenv
(
"HOME"
,
""
),
"$HOME"
)
kwargs
=
{
"poetry"
:
colorize
(
"info"
,
"Poetry"
),
"poetry_home_bin"
:
colorize
(
"comment"
,
POETRY_BIN
.
replace
(
os
.
getenv
(
"HOME"
,
""
),
"$HOME"
)
.
replace
(
os
.
getenv
(
"USERPROFILE"
,
""
),
"
%
USERPROFILE
%
"
),
),
"poetry_home_bin"
:
colorize
(
"comment"
,
home_bin
),
}
print
(
PRE_UNINSTALL_MESSAGE
.
format
(
**
kwargs
))
...
...
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