Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
elixir/bin/elixir at main · elixir-lang/elixir · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
elixir-lang
elixir
Repository navigation
Code
Issues
27
(27)
Pull requests
8
(8)
Actions
Wiki
Security and quality
2
(2)
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
elixir
/
bin
/
elixir
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
246 lines (213 loc) · 6.51 KB
main
Breadcrumbs
elixir
/
bin
/
elixir
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
246 lines (213 loc) · 6.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#!
/bin/sh
#
SPDX-License-Identifier: Apache-2.0
#
SPDX-FileCopyrightText: 2021 The Elixir Team
#
SPDX-FileCopyrightText: 2012 Plataformatec
set
-e
ELIXIR_VERSION=1.21.0-dev
if
[
$#
-eq
0 ]
||
{ [
$#
-eq
1 ]
&&
{ [
"
$1
"
=
"
--help
"
]
||
[
"
$1
"
=
"
-h
"
]
;
}
;
}
;
then
cat
<<
USAGE
>&2
Usage:
$(
basename
"
$0
"
)
[options] [.exs file] [data]
## General options
-e "COMMAND" Evaluates the given command (*)
-h, --help Prints this message (standalone)
-r "FILE" Requires the given files/patterns (*)
-S SCRIPT Finds and executes the given script in
\$
PATH
-pr "FILE" Requires the given files/patterns in parallel (*)
-pa "PATH" Prepends the given path to Erlang code path (*)
-pz "PATH" Appends the given path to Erlang code path (*)
-v, --version Prints Erlang/OTP and Elixir versions (standalone)
--color, --no-color Enables or disables ANSI coloring
--erl "SWITCHES" Switches to be passed down to Erlang (*)
--eval "COMMAND" Evaluates the given command, same as -e (*)
--logger-otp-reports BOOL Enables or disables OTP reporting
--logger-sasl-reports BOOL Enables or disables SASL reporting
--no-halt Does not halt the Erlang VM after execution
--short-version Prints Elixir version (standalone)
Options given after the .exs file or -- are passed down to the executed code.
Options can be passed to the Erlang runtime using
\$
ELIXIR_ERL_OPTIONS or --erl.
## Distribution options
The following options are related to node distribution.
--cookie COOKIE Sets a cookie for this distributed node
--hidden Makes a hidden node
--name NAME Makes and assigns a name to the distributed node
--rpc-eval NODE "COMMAND" Evaluates the given command on the given remote node (*)
--sname NAME Makes and assigns a short name to the distributed node
--name and --sname may be set to undefined so one is automatically generated.
## Release options
The following options are generally used under releases.
--boot "FILE" Uses the given FILE.boot to start the system
--boot-var VAR "VALUE" Makes
\$
VAR available as VALUE to FILE.boot (*)
--erl-config "FILE" Loads configuration in FILE.config written in Erlang (*)
--pipe-to "PIPEDIR" "LOGDIR" Starts the Erlang VM as a named PIPEDIR and LOGDIR
--vm-args "FILE" Passes the contents in file as arguments to the VM
--pipe-to starts Elixir detached from console (Unix-like only).
It will attempt to create PIPEDIR and LOGDIR if they don't exist.
See run_erl to learn more. To reattach, run: to_erl PIPEDIR.
** Options marked with (*) can be given more than once.
** Standalone options can't be combined with other options.
USAGE
exit
1
fi
readlink_f
() {
cd
"
$(
dirname
"
$1
"
)
"
>
/dev/null
filename=
"
$(
basename
"
$1
"
)
"
if
[
-h
"
$filename
"
]
;
then
readlink_f
"
$(
readlink
"
$filename
"
)
"
else
echo
"
$(
pwd -P
)
/
$filename
"
fi
}
if
[
$#
-eq
1 ]
&&
[
"
$1
"
=
"
--short-version
"
]
;
then
echo
"
$ELIXIR_VERSION
"
exit
0
fi
#
Stores static Erlang arguments and --erl (which is passed as is)
ERL=
"
"
#
Stores erl arguments preserving spaces/quotes (mimics an array)
erl_set
() {
eval
"
E
${E}
=
\$
1
"
E=
$((
E
+
1
))
}
#
Checks if a string starts with prefix. Usage: starts_with "$STRING" "$PREFIX"
starts_with
() {
case
$1
in
"
$2
"
*
)
true
;;
*
)
false
;;
esac
}
ERL_EXEC=
"
erl
"
MODE=
"
cli
"
I=1
E=0
LENGTH=
$#
set
--
"
$@
"
-extra
while
[
$I
-le
$LENGTH
]
;
do
#
S counts to be shifted, C counts to be copied
S=0
C=0
case
"
$1
"
in
+elixirc)
C=1
;;
+iex)
C=1
MODE=
"
iex
"
;;
-v|--no-halt|--color|--no-color)
C=1
;;
-e|-r|-pr|-pa|-pz|--eval|--remsh|--dot-iex|--dbg)
C=2
;;
--rpc-eval)
C=3
;;
--hidden)
S=1
ERL=
"
$ERL
-hidden
"
;;
--logger-otp-reports)
S=2
if
[
"
$2
"
=
'
true
'
]
||
[
"
$2
"
=
'
false
'
]
;
then
ERL=
"
$ERL
-logger handle_otp_reports
$2
"
fi
;;
--logger-sasl-reports)
S=2
if
[
"
$2
"
=
'
true
'
]
||
[
"
$2
"
=
'
false
'
]
;
then
ERL=
"
$ERL
-logger handle_sasl_reports
$2
"
fi
;;
--erl)
S=2
ERL=
"
$ERL
$2
"
;;
--cookie)
S=2
erl_set
"
-setcookie
"
erl_set
"
$2
"
;;
--sname|--name)
S=2
erl_set
"
$(
echo
"
$1
"
|
cut -c 2-
)
"
erl_set
"
$2
"
;;
--erl-config)
S=2
erl_set
"
-config
"
erl_set
"
$2
"
;;
--vm-args)
S=2
erl_set
"
-args_file
"
erl_set
"
$2
"
;;
--boot)
S=2
erl_set
"
-boot
"
erl_set
"
$2
"
;;
--boot-var)
S=3
erl_set
"
-boot_var
"
erl_set
"
$2
"
erl_set
"
$3
"
;;
--pipe-to)
S=3
RUN_ERL_PIPE=
"
$2
"
RUN_ERL_LOG=
"
$3
"
if
[
"
$(
starts_with
"
$RUN_ERL_PIPE
"
"
-
"
)
"
]
;
then
echo
"
--pipe-to : PIPEDIR cannot be a switch
"
>&2
&&
exit
1
elif
[
"
$(
starts_with
"
$RUN_ERL_LOG
"
"
-
"
)
"
]
;
then
echo
"
--pipe-to : LOGDIR cannot be a switch
"
>&2
&&
exit
1
fi
;;
*
)
while
[
$I
-le
$LENGTH
]
;
do
I=
$((
I
+
1
))
set
--
"
$@
"
"
$1
"
shift
done
break
;;
esac
while
[
$I
-le
$LENGTH
]
&&
[
$C
-gt
0 ]
;
do
C=
$((
C
-
1
))
I=
$((
I
+
1
))
set
--
"
$@
"
"
$1
"
shift
done
I=
$((
I
+
S
))
shift
$S
done
I=
$((
E
-
1
))
while
[
$I
-ge
0 ]
;
do
eval
"
VAL=
\$
E
$I
"
set
--
"
$VAL
"
"
$@
"
I=
$((
I
-
1
))
done
SELF=
$(
readlink_f
"
$0
"
)
SCRIPT_PATH=
$(
dirname
"
$SELF
"
)
if
[
"
$OSTYPE
"
=
"
cygwin
"
]
;
then
SCRIPT_PATH=
$(
cygpath -m
"
$SCRIPT_PATH
"
)
;
fi
if
[
"
$MODE
"
!=
"
iex
"
]
;
then
ERL=
"
-s elixir start_cli
$ERL
"
;
fi
#
One MAY change ERTS_BIN= but you MUST NOT change
#
ERTS_BIN=$ERTS_BIN as it is handled by Elixir releases.
ERTS_BIN=
ERTS_BIN=
"
$ERTS_BIN
"
set
--
"
$ERTS_BIN$ERL_EXEC
"
-noshell -elixir_root
"
$SCRIPT_PATH
"
/../lib -pa
"
$SCRIPT_PATH
"
/../lib/elixir/ebin
$ELIXIR_ERL_OPTIONS
$ERL
"
$@
"
if
[
-n
"
$RUN_ERL_PIPE
"
]
;
then
ESCAPED=
"
"
for
PART
in
"
$@
"
;
do
ESCAPED=
"
$ESCAPED
$(
printf
'
%s
'
"
$PART
"
|
sed
'
s@[^a-zA-Z0-9_/-]@\\&@g
'
)
"
done
mkdir -p
"
$RUN_ERL_PIPE
"
mkdir -p
"
$RUN_ERL_LOG
"
ERL_EXEC=
"
run_erl
"
set
--
"
$ERTS_BIN$ERL_EXEC
"
-daemon
"
$RUN_ERL_PIPE
/
"
"
$RUN_ERL_LOG
/
"
"
$ESCAPED
"
fi
if
[
-n
"
$ELIXIR_CLI_DRY_RUN
"
]
;
then
echo
"
$@
"
else
exec
"
$@
"
fi
You can’t perform that action at this time.