FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
faraday/scripts/create-wrapper-scripts.sh at master · infobyte/faraday · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
infobyte
/
faraday
Public
Notifications
You must be signed in to change notification settings
Fork
1.1k
Star
6.7k
Code
Issues
9
Pull requests
17
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
faraday
/
scripts
/
create-wrapper-scripts.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
64 lines (51 loc) · 1.78 KB
Breadcrumbs
faraday
/
scripts
/
create-wrapper-scripts.sh
Copy path
File metadata and controls
executable file
·
64 lines (51 loc) · 1.78 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
#!
/usr/bin/env bash
#
#
Create wrapper scripts for Faraday entry points
#
#
Usage: ./create-wrapper-scripts.sh INSTALL_PREFIX
#
Example: ./create-wrapper-scripts.sh /opt/faraday
#
#
This script generates wrapper scripts that:
#
- Use the bundled Python interpreter
#
- Set environment variables (LD_LIBRARY_PATH)
#
- Call the actual entry points from the venv
#
set
-euo pipefail
INSTALL_PREFIX=
"
${1
:?
ERROR
:
INSTALL_PREFIX required as first argument}
"
VENV_BIN=
"
${INSTALL_PREFIX}
/venv/bin
"
BUNDLED_PYTHON=
"
${INSTALL_PREFIX}
/python/bin/python3.11
"
WRAPPER_DIR=
"
${INSTALL_PREFIX}
/bin
"
echo
"
==> Creating wrapper scripts in
${WRAPPER_DIR}
"
#
Create wrapper directory
mkdir -p
"
${WRAPPER_DIR}
"
#
Entry points from pyproject.toml [project.scripts]
ENTRY_POINTS=(
"
faraday-server
"
"
faraday-manage
"
"
faraday-worker
"
"
faraday-worker-gevent
"
"
faraday-beat
"
"
faraday-start-all
"
)
for
entry
in
"
${ENTRY_POINTS[@]}
"
;
do
echo
"
==> Creating wrapper for
${entry}
"
cat
>
"
${WRAPPER_DIR}
/
${entry}
"
<<
'
WRAPPER_EOF
'
#!/bin/bash
# Wrapper script for ENTRY_POINT
# Auto-generated by create-wrapper-scripts.sh
# Determine installation directory (resolve symlinks)
SCRIPT_PATH="$(readlink -f "${BASH_SOURCE[0]}")"
INSTALL_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
# Set environment variables
export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib64:${LD_LIBRARY_PATH:-}"
# Execute the actual entry point from venv
exec "${INSTALL_DIR}/venv/bin/ENTRY_POINT" "$@"
WRAPPER_EOF
#
Replace placeholder with actual entry point name
sed -i
"
s/ENTRY_POINT/
${entry}
/g
"
"
${WRAPPER_DIR}
/
${entry}
"
#
Make executable
chmod +x
"
${WRAPPER_DIR}
/
${entry}
"
done
echo
"
==> Successfully created
${
#
ENTRY_POINTS[@]}
wrapper scripts
"
echo
"
==> Wrapper scripts:
"
ls -lh
"
${WRAPPER_DIR}
"
/faraday-
*
Back
|
FazBrowse Home
|
New Git URL