Skip to content

Commit c584848

Browse files
committed
fix: while saving the environment variable: DISPLAY a new line was missing
1 parent c056d0e commit c584848

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 0.3.1 (2019-Feb-04)
2+
3+
* fix: while saving the environment variable: DISPLAY a new line was missing
4+
15
### 0.3.0 (2019-Feb-04)
26

37
Change default behavior that preserved current environment (by the means of environment file) only to the default

environment_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func generateVariablesString(blacklistedVarsNames string, allVariables []string)
5656
value := arr[1]
5757
if key == "DISPLAY" {
5858
// this is highly opinionated
59-
generatedString += "DISPLAY=unix:0.0"
59+
generatedString += "DISPLAY=unix:0.0\n"
6060
} else if existsVariableWithDOJOPrefix(key, allVariables) {
6161
// ignore this key, we will deal with DOJO_${key}
6262
continue

environment_service_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ func Test_generateVariablesString(t *testing.T) {
3939
// MYVAR is not blacklisted, is not set with DOJO_ prefix
4040
// DOJO_VAR1 is not blacklisted, is set with DOJO_ prefix
4141
// DISPLAY is always set to the same value
42-
allVariables := []string{"USER=dojo", "BASH_123=123", "DOJO_USER=555", "MYVAR=999", "DOJO_VAR1=11", "USER1=1", "DOJO_USER1=2", "DISPLAY=aaa"}
42+
allVariables := []string{"USER=dojo", "BASH_123=123", "DOJO_USER=555", "MYVAR=999", "DOJO_VAR1=11", "USER1=1", "DISPLAY=aaa", "DOJO_USER1=2"}
4343
genStr := generateVariablesString(blacklisted, allVariables)
44-
assert.Contains(t, genStr, "DOJO_USER=555")
45-
assert.Contains(t, genStr, "DOJO_BASH_123=123")
46-
assert.Contains(t, genStr, "MYVAR=999")
47-
assert.Contains(t, genStr, "DOJO_VAR1=11")
48-
assert.Contains(t, genStr, "DOJO_USER1=2")
49-
assert.Contains(t, genStr, "DISPLAY=unix:0.0")
44+
assert.Contains(t, genStr, "DOJO_USER=555\n")
45+
assert.Contains(t, genStr, "DOJO_BASH_123=123\n")
46+
assert.Contains(t, genStr, "MYVAR=999\n")
47+
assert.Contains(t, genStr, "DOJO_VAR1=11\n")
48+
assert.Contains(t, genStr, "DOJO_USER1=2\n")
49+
assert.Contains(t, genStr, "DISPLAY=unix:0.0\n")
5050
assert.NotContains(t, genStr, "DOJO_USER=dojo")
5151
assert.NotContains(t, genStr, "USER1=1")
5252
assert.NotContains(t, genStr, "DISPLAY=aaa")

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package main
2-
const DojoVersion = "0.3.0"
2+
const DojoVersion = "0.3.1"
33

0 commit comments

Comments
 (0)