Detect-It-Easy/autotools/dbcompiler/node_modules_clean.cmd
DosX ed043323b7 Add script to extract licenses & run modclean
Add Windows batch script node_modules_clean.cmd that copies LICENSE/LICENCE/COPYING files from node_modules into a node_licenses directory (creating it if missing), renaming saved files to include package names, and invokes npx modclean -n default:safe -r to remove extraneous files. Intended to gather third-party licenses for offline/legal distribution and clean node_modules.
2026-05-09 19:19:44 +03:00

20 lines
No EOL
468 B
Batchfile

@echo off
set "TARGET_DIR=node_licenses"
if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%"
echo [1/3] Copying licenses...
for /r "node_modules" %%f in (*LICENSE* *LICENCE* *COPYING*) do (
if not exist "%%f\" (
for %%p in ("%%f\..") do copy /y "%%f" "%TARGET_DIR%\LICENSE.%%~nxp.txt" >nul
)
)
echo [2/3] Licenses saved in \%TARGET_DIR%\
echo [3/3] Running modclean...
call npx modclean -n default:safe -r
echo Done! Offline-ready and legally safe.