Skip to content

Commit

Permalink
build: update wsl+docker execution scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
meskill committed May 22, 2022
1 parent 6cd535d commit ccb1c15
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .devcontainer/execute.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#! /usr/bin/env fish

echo "Run any cargo command"

while true
set -l command (cat .devcontainer/command-pipe)
set path (cat .devcontainer/command-pipe)

kill %1
reset
eval $command

set previous_path $path

eval "$path &"
end
2 changes: 1 addition & 1 deletion .devcontainer/send.fish
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /usr/bin/env fish

echo (string replace $CONTAINER_PROJECT_HOME $HOST_PROJECT_HOME $argv) > .devcontainer/command-pipe
echo (string replace $CONTAINER_PROJECT_HOME $HOST_PROJECT_HOME (realpath $argv)) > ./.devcontainer/command-pipe
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ For this either use Remote Containers extension with the provided `.devcontainer
2. Mount existing named pipe and scripts to the docker container `type=bind,src=${localWorkspaceFolder}/.devcontainer,dst=${containerWorkspaceFolder}/.devcontainer`
3. Specify environment variables for container `CONTAINER_PROJECT_HOME` - path to the project inside the container, `HOST_PROJECT_HOME` - path to projects in WSL
4. Run the container
5. You can use `wsl2-docker.env` in order fill needed environment variable that will wrap execution for the program run
6. Inside WSL start script `.devcontainer/execute.fish` that will listen for new commands and execute it
5. You can use `wsl2-docker.env` in order to fill needed environment variable that will wrap execution for the program run
6. Start new WSL terminal with admin right and execute script `.devcontainer/execute.fish` that will listen for new commands and execute it
7. Run `cargo test`
8. Execution will end without any info, but you should see test running output in the WSL terminal

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccb1c15

Please sign in to comment.