Skip to content

Commit cdbfa76

Browse files
Merge pull request #13 from datastack-net/feature/rust
Feature/rust
2 parents 1c470b6 + fcb586f commit cdbfa76

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ PROTOC_BASE=${DEFAULT_BASE}
2323
PYTHON_VERSION=3.10
2424
PYTHON2_VERSION=2.7.18
2525
RUBY_VERSION=3.1.1
26+
RUST_VERSION=1.59.0
2627
S3CMD_BASE=python:${PYTHON_VERSION}-${DEFAULT_BASE_IMAGE}
2728
S3CMD_VERSION=2.2.0
2829
SWAGGER_CODEGEN_VERSION=3.0.29

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
- go
1313
- aws
1414
- python
15+
- rustc
16+
- zip
1517
runs-on: ubuntu-latest
1618
steps:
1719
- name: Checkout Dockerized

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ dockerized <command>
4545
- python
4646
- python2
4747
- ruby
48+
- rustc (rust compiler)
4849
- Unix
4950
- tree
51+
- zip
5052

5153

5254
## Installation

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ services:
134134
ruby:
135135
image: "ruby:${RUBY_VERSION}"
136136
entrypoint: [ "ruby" ]
137-
# rustc:
138-
# image: "rust:${RUST_VERSION}"
139-
# entrypoint: [ "rustc" ]
137+
rustc:
138+
image: "rust:${RUST_VERSION}"
139+
entrypoint: [ "rustc" ]
140140
s3cmd:
141141
build:
142142
context: apps/s3cmd

lib/dockerized.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,21 @@ func main() {
145145
}
146146
welcomeMessage = strings.ReplaceAll(welcomeMessage, "\\", "\\\\")
147147

148-
preferredShells := "bash zsh sh"
148+
shells := []string{
149+
"bash",
150+
"zsh",
151+
"sh",
152+
}
153+
var shellDetectionCommands []string
154+
for _, shell := range shells {
155+
shellDetectionCommands = append(shellDetectionCommands, "command -v "+shell)
156+
}
157+
for _, shell := range shells {
158+
shellDetectionCommands = append(shellDetectionCommands, "which "+shell)
159+
}
160+
149161
var cmdPrintWelcome = fmt.Sprintf("echo '%s'", color.YellowString(welcomeMessage))
150-
var cmdLaunchShell = fmt.Sprintf("$(command -v %[1]s | head -n1 || which %[1]s | head -n1)", preferredShells)
162+
var cmdLaunchShell = fmt.Sprintf("$(%s)", strings.Join(shellDetectionCommands, " || "))
151163

152164
runOptions.Environment = append(runOptions.Environment, "PS1="+ps1)
153165
runOptions.Entrypoint = []string{"/bin/sh"}

0 commit comments

Comments
 (0)