-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathcommand_substitution_feature.test
More file actions
115 lines (102 loc) · 2.66 KB
/
command_substitution_feature.test
File metadata and controls
115 lines (102 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
DATE=$(date)
SHORT_HASH=$(git rev-parse --short HEAD)
LONG_HASH=`git rev-parse HEAD`
BUILD_ID="build-$(uuidgen)"
PWD_MESSAGE="Running from $(pwd)"
DATABASE_URL="postgres://$(whoami)@localhost/my_database"
WITH_SUBSTITUTION=postgres://$(whoami)@localhost/my_database
NO_SUBSTITUTION='postgres://$(whoami)@localhost/my_database'
AND_HERE=`Some text...
postgres://$(whoami)@localhost/my_database`
----------------------------------------------------
[
["key", "DATE"],
["assignment-operator", "="],
["value", [
["command-substitution", [
["command-substitution-punctuation", "$("],
["shell-command", "date"],
["command-substitution-punctuation", ")"]
]]
]],
["key", "SHORT_HASH"],
["assignment-operator", "="],
["value", [
["command-substitution", [
["command-substitution-punctuation", "$("],
["shell-command", "git rev-parse --short HEAD"],
["command-substitution-punctuation", ")"]
]]
]],
["key", "LONG_HASH"],
["assignment-operator", "="],
["value", [
["punctuation", "`"],
"git rev-parse HEAD",
["punctuation", "`"]
]],
["key", "BUILD_ID"],
["assignment-operator", "="],
["value", [
["punctuation", "\""],
"build-",
["command-substitution", [
["command-substitution-punctuation", "$("],
["shell-command", "uuidgen"],
["command-substitution-punctuation", ")"]
]],
["punctuation", "\""]
]],
["key", "PWD_MESSAGE"],
["assignment-operator", "="],
["value", [
["punctuation", "\""],
"Running from ",
["command-substitution", [
["command-substitution-punctuation", "$("],
["shell-command", "pwd"],
["command-substitution-punctuation", ")"]
]],
["punctuation", "\""]
]],
["key", "DATABASE_URL"],
["assignment-operator", "="],
["value", [
["punctuation", "\""],
"postgres://",
["command-substitution", [
["command-substitution-punctuation", "$("],
["shell-command", "whoami"],
["command-substitution-punctuation", ")"]
]],
"@localhost/my_database",
["punctuation", "\""]
]],
["key", "WITH_SUBSTITUTION"],
["assignment-operator", "="],
["value", [
"postgres://",
["command-substitution", [
["command-substitution-punctuation", "$("],
["shell-command", "whoami"],
["command-substitution-punctuation", ")"]
]],
"@localhost/my_database"
]],
["key", "NO_SUBSTITUTION"],
["assignment-operator", "="],
["value", [
["punctuation", "'"],
"postgres://$(whoami)@localhost/my_database",
["punctuation", "'"]
]],
["key", "AND_HERE"],
["assignment-operator", "="],
["value", [
["punctuation", "`"],
"Some text...\r\npostgres://$(whoami)@localhost/my_database",
["punctuation", "`"]
]]
]
----------------------------------------------------
Check for command substitution.