-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathdocker.bat
More file actions
23 lines (19 loc) · 720 Bytes
/
docker.bat
File metadata and controls
23 lines (19 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@ECHO off
REM #!/bin/bash
REM
REM # check if started in WSL
REM if [[ $(uname -r) =~ Microsoft$ ]]; then
REM # if WSL
REM docker container run --rm -it -v "$(wslpath -a -m .)":/full-fledged-hledger dastapov/full-fledged-hledger:latest
REM else
REM # otherwise
REM docker container run --rm -it -v "$(pwd)":/full-fledged-hledger dastapov/full-fledged-hledger:latest
REM fi
REM capture the path to $0 ie this script
SET mypath=%~dp0
REM strip last char
SET PREFIXPATH=%mypath:~0,-1%
REM swap \ for / in the path
REM because docker likes it that way in volume mounting
SET PPATH=%PREFIXPATH:\=/%
docker.exe container run --rm -it -v "%PPATH%":/full-fledged-hledger dastapov/full-fledged-hledger:latest