mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
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.
20 lines
No EOL
468 B
Batchfile
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. |