a6c135a934
Co-authored-by: Matt Thalman <mthalman@microsoft.com>
22 lines
507 B
Bash
Executable file
22 lines
507 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#installation-as-a-library-via-pip
|
|
|
|
pyEnvPath="/tmp/scancode-env"
|
|
python3 -m venv $pyEnvPath
|
|
source $pyEnvPath/bin/activate
|
|
pip install scancode-toolkit
|
|
deactivate
|
|
|
|
# Setup a script which executes scancode in the virtual environment
|
|
cat > /usr/local/bin/scancode << EOF
|
|
#!/bin/bash
|
|
set -euo pipefail
|
|
source $pyEnvPath/bin/activate
|
|
scancode "\$@"
|
|
deactivate
|
|
EOF
|
|
|
|
chmod +x /usr/local/bin/scancode
|