Skip to content

Commit

Permalink
feat: Support writing for linux (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Jun 16, 2023
1 parent eb32932 commit 11bbacf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"label": "Run",
"dependsOn": [
"Run mkdocs-dev",
"View docker-compose logs",
"Open browser"
],
"runOptions": {
Expand All @@ -20,7 +19,12 @@
{
"label": "Run mkdocs-dev",
"type": "shell",
"command": "${workspaceFolder}/scripts/mkdocs-dev.ps1"
"windows": {
"command": "${workspaceFolder}/scripts/mkdocs-dev.ps1"
},
"linux": {
"command": "${workspaceFolder}/scripts/mkdocs-dev.sh"
}
},
{
"label": "Open browser",
Expand Down
2 changes: 2 additions & 0 deletions scripts/mkdocs-dev.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ $ErrorActionPreference = "stop"
Set-Location $PSScriptRoot
Set-Location ..

# check exists venv
if (!(Test-Path -Path venv)) {
python3 -mvenv venv
}

# activate venv
venv\Scripts\activate
pip install -r requirements.txt

Expand Down
16 changes: 16 additions & 0 deletions scripts/mkdocs-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

cd "$(dirname "$0")" || exit
cd ..

# check exists venv
if [ ! -d "venv" ]; then
python3 -m venv venv
fi

# activate venv
source venv/bin/activate
pip install -r requirements.txt

mkdocs serve --dev-addr=0.0.0.0:8080

0 comments on commit 11bbacf

Please sign in to comment.