mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
20 lines
522 B
Bash
20 lines
522 B
Bash
#!/bin/bash
|
|
|
|
TARGET_DIR="node_licenses"
|
|
|
|
mkdir -p "$TARGET_DIR"
|
|
|
|
echo "[1/3] Copying licenses..."
|
|
|
|
while IFS= read -r -d '' f; do
|
|
pkg_name=$(basename "$(dirname "$f")")
|
|
fname=$(basename "$f")
|
|
cp "$f" "$TARGET_DIR/${pkg_name}_${fname}.txt"
|
|
done < <(find node_modules -type f \( -iname "*LICENSE*" -o -iname "*LICENCE*" -o -iname "*COPYING*" \) -print0)
|
|
|
|
echo "[2/3] Licenses saved in /$TARGET_DIR/"
|
|
|
|
echo "[3/3] Running modclean..."
|
|
npx modclean -n default:safe -r
|
|
|
|
echo "Done! Offline-ready and legally safe."
|