Skip to content

Commit e68e0d1

Browse files
Modify existing tool.poetry section instead of creating new one which causes error (#4)
1 parent fd49556 commit e68e0d1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

20-poetry.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Check if Poetry is installed
24
if ! command -v poetry &> /dev/null
35
then
@@ -15,21 +17,15 @@ fi
1517
# Initialize a new Poetry project with the project name
1618
poetry init --name "$POETRY_PROJECT_NAME" --no-interaction
1719

18-
# Switch to non-package-mode
19-
cat <<EOF >> pyproject.toml
20-
21-
[tool.poetry]
22-
package-mode = false
23-
EOF
20+
# Modify the existing [tool.poetry] section to add package-mode = false
21+
sed -i '/^\[tool.poetry\]/a package-mode = false' pyproject.toml
2422

25-
# add python stuff to gitignore
2623
echo "__pycache__/" >> .gitignore
2724

28-
# describe in the README
2925
cat <<EOF >> "README.md"
3026
# $POETRY_PROJECT_NAME
3127
32-
## Python deps
28+
## Python dependencies
3329
3430
This project uses Poetry for dependency management. To install the dependencies, run:
3531

0 commit comments

Comments
 (0)