Answer the question
In order to leave comments, you need to log in
How to merge all project files into one?
There is a project located, say, on c:/bh/front
Inside - a bunch of subfolders and files
We need a script that will recursively go through all subfolders, take the contents of each file (for example, by *.php, *.vue, *.js mask ) and will drive it into one output file, let's say c:/bh/froutoutput.txt
well, and so that there is no porridge at all - preferably before each piece of code - so that the file name is written.
Something like this:
froutoutput.txt:
Файл: c:\bh\front\components\Addresses.vue
<тут содержимое файла Addresses.vue>
Файл: c:\bh\front\components\catalog\CatalogBody.vue
<тут содержимое файла CatalogBody.vue>
Answer the question
In order to leave comments, you need to log in
The simplest option:
set SOURCEDIR=c:/bh/front
set OUTPUT=c:/bh/froutoutput.txt
pushd %SOURCEDIR$
for /r %F in (*.php) do (
echo ================= >> %OUTPUT%
echo Файл: %~fF >> %OUTPUT%
type %~fF >> %OUTPUT%
)
popd
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question