yiisoft / yii-dev-tool

Development environment for Yii 3 packages
https://www.yiiframework.com/
69 stars 36 forks source link

Add support for deleting files to replicate command #40

Closed samdark closed 4 years ago

samdark commented 4 years ago

https://github.com/yiisoft/yii-dev-tool/blob/master/replicate.php#L5 there could be another section in the config called "filesToDelete".

samdark commented 4 years ago

That is needed because when we'll need some kind of a service to be removed we'll need to also delete replicated config file from all our repositories.

rugabarbo commented 4 years ago

Workaround (bash):

cd yii-dev-tool
find . -type f -path './dev/*/.github/FUNDING.yml' -exec rm -f {} \; -print

This command will delete all .github/FUNDING.yml files from the repositories and display the affected files.

Output: ```bash ./dev/network-utilities/.github/FUNDING.yml ./dev/rbac/.github/FUNDING.yml ./dev/log-target-db/.github/FUNDING.yml ./dev/db-mongodb/.github/FUNDING.yml ./dev/yii-base-web/.github/FUNDING.yml ./dev/strings/.github/FUNDING.yml ./dev/db-mssql/.github/FUNDING.yml ./dev/serializer/.github/FUNDING.yml ./dev/di/.github/FUNDING.yml ./dev/yii-debug/.github/FUNDING.yml ./dev/cache-apcu/.github/FUNDING.yml ./dev/rbac-php/.github/FUNDING.yml ./dev/cache-file/.github/FUNDING.yml ./dev/validator/.github/FUNDING.yml ./dev/log-target-file/.github/FUNDING.yml ./dev/yii-dataview/.github/FUNDING.yml ./dev/log-target-syslog/.github/FUNDING.yml ./dev/cache/.github/FUNDING.yml ./dev/cache-wincache/.github/FUNDING.yml ./dev/access/.github/FUNDING.yml ./dev/yii-queue-interop/.github/FUNDING.yml ./dev/security/.github/FUNDING.yml ./dev/i18n-message-php/.github/FUNDING.yml ./dev/db-pgsql/.github/FUNDING.yml ./dev/yii-rest/.github/FUNDING.yml ./dev/yii-web/.github/FUNDING.yml ./dev/i18n-message-gettext/.github/FUNDING.yml ./dev/db-mysql/.github/FUNDING.yml ./dev/mutex-file/.github/FUNDING.yml ./dev/db-oracle/.github/FUNDING.yml ./dev/event-dispatcher/.github/FUNDING.yml ./dev/template/.github/FUNDING.yml ./dev/var-dumper/.github/FUNDING.yml ./dev/yii-queue/.github/FUNDING.yml ./dev/yii-project-template/.github/FUNDING.yml ./dev/html/.github/FUNDING.yml ./dev/mailer/.github/FUNDING.yml ./dev/db-sqlite/.github/FUNDING.yml ./dev/requirements/.github/FUNDING.yml ./dev/docs/.github/FUNDING.yml ./dev/yii-auth-client/.github/FUNDING.yml ./dev/yii-console/.github/FUNDING.yml ./dev/rbac-db/.github/FUNDING.yml ./dev/cache-db/.github/FUNDING.yml ./dev/yii-cycle/.github/FUNDING.yml ./dev/mutex-db-oracle/.github/FUNDING.yml ./dev/yii-jquery/.github/FUNDING.yml ./dev/json/.github/FUNDING.yml ./dev/i18n-formatter-intl/.github/FUNDING.yml ./dev/mutex-db-pgsql/.github/FUNDING.yml ./dev/arrays/.github/FUNDING.yml ./dev/router-fastroute/.github/FUNDING.yml ./dev/view/.github/FUNDING.yml ./dev/log-target-email/.github/FUNDING.yml ./dev/mutex-db-mysql/.github/FUNDING.yml ./dev/files/.github/FUNDING.yml ./dev/db/.github/FUNDING.yml ./dev/yii-masked-input/.github/FUNDING.yml ./dev/log/.github/FUNDING.yml ./dev/yii-demo/.github/FUNDING.yml ./dev/profiler/.github/FUNDING.yml ./dev/mutex/.github/FUNDING.yml ./dev/yii-bootstrap4/.github/FUNDING.yml ./dev/friendlyexception/.github/FUNDING.yml ./dev/i18n/.github/FUNDING.yml ./dev/aliases/.github/FUNDING.yml ./dev/data/.github/FUNDING.yml ./dev/yii-gii/.github/FUNDING.yml ./dev/yii-docker/.github/FUNDING.yml ./dev/yii-base-api/.github/FUNDING.yml ./dev/factory/.github/FUNDING.yml ./dev/mailer-swiftmailer/.github/FUNDING.yml ./dev/yii-captcha/.github/FUNDING.yml ./dev/injector/.github/FUNDING.yml ./dev/router/.github/FUNDING.yml ```
rugabarbo commented 4 years ago

If PR #54 is accepted, then such tasks can be solved as follows:

cd yii-dev-tool
./yii-dev exec 'rm -fv .github/FUNDING.yml'
Output: ```bash ▶ Executing command in package docs removed '.github/FUNDING.yml' ▶ Executing command in package di removed '.github/FUNDING.yml' ▶ Executing command in package injector removed '.github/FUNDING.yml' ▶ Executing command in package factory removed '.github/FUNDING.yml' ▶ Executing command in package access removed '.github/FUNDING.yml' ▶ Executing command in package event-dispatcher removed '.github/FUNDING.yml' ▶ Executing command in package security removed '.github/FUNDING.yml' ▶ Executing command in package data removed '.github/FUNDING.yml' ▶ Executing command in package profiler removed '.github/FUNDING.yml' ▶ Executing command in package aliases removed '.github/FUNDING.yml' ▶ Executing command in package serializer removed '.github/FUNDING.yml' ▶ Executing command in package network-utilities removed '.github/FUNDING.yml' ▶ Executing command in package auth removed '.github/FUNDING.yml' ▶ Executing command in package cache removed '.github/FUNDING.yml' ▶ Executing command in package cache-apcu removed '.github/FUNDING.yml' ▶ Executing command in package cache-wincache removed '.github/FUNDING.yml' ▶ Executing command in package cache-file removed '.github/FUNDING.yml' ▶ Executing command in package cache-db removed '.github/FUNDING.yml' ▶ Executing command in package rbac removed '.github/FUNDING.yml' ▶ Executing command in package rbac-db removed '.github/FUNDING.yml' ▶ Executing command in package rbac-php removed '.github/FUNDING.yml' ▶ Executing command in package log removed '.github/FUNDING.yml' ▶ Executing command in package log-target-db removed '.github/FUNDING.yml' ▶ Executing command in package log-target-email removed '.github/FUNDING.yml' ▶ Executing command in package log-target-file removed '.github/FUNDING.yml' ▶ Executing command in package log-target-syslog removed '.github/FUNDING.yml' ▶ Executing command in package i18n removed '.github/FUNDING.yml' ▶ Executing command in package i18n-message-php removed '.github/FUNDING.yml' ▶ Executing command in package i18n-message-gettext removed '.github/FUNDING.yml' ▶ Executing command in package i18n-formatter-intl removed '.github/FUNDING.yml' ▶ Executing command in package yii-queue removed '.github/FUNDING.yml' ▶ Executing command in package yii-queue-interop removed '.github/FUNDING.yml' ▶ Executing command in package mutex removed '.github/FUNDING.yml' ▶ Executing command in package mutex-file removed '.github/FUNDING.yml' ▶ Executing command in package mutex-db-pgsql removed '.github/FUNDING.yml' ▶ Executing command in package mutex-db-oracle removed '.github/FUNDING.yml' ▶ Executing command in package mutex-db-mysql removed '.github/FUNDING.yml' ▶ Executing command in package mailer removed '.github/FUNDING.yml' ▶ Executing command in package mailer-swiftmailer removed '.github/FUNDING.yml' ▶ Executing command in package arrays removed '.github/FUNDING.yml' ▶ Executing command in package strings removed '.github/FUNDING.yml' ▶ Executing command in package files removed '.github/FUNDING.yml' ▶ Executing command in package var-dumper removed '.github/FUNDING.yml' ▶ Executing command in package html removed '.github/FUNDING.yml' ▶ Executing command in package json removed '.github/FUNDING.yml' ▶ Executing command in package yii-console removed '.github/FUNDING.yml' ▶ Executing command in package yii-rest removed '.github/FUNDING.yml' ▶ Executing command in package db removed '.github/FUNDING.yml' ▶ Executing command in package db-mysql removed '.github/FUNDING.yml' ▶ Executing command in package db-pgsql removed '.github/FUNDING.yml' ▶ Executing command in package db-sqlite removed '.github/FUNDING.yml' ▶ Executing command in package db-mssql removed '.github/FUNDING.yml' ▶ Executing command in package db-oracle removed '.github/FUNDING.yml' ▶ Executing command in package db-mongodb removed '.github/FUNDING.yml' ▶ Executing command in package active-record removed '.github/FUNDING.yml' ▶ Executing command in package yii-cycle removed '.github/FUNDING.yml' ▶ Executing command in package router removed '.github/FUNDING.yml' ▶ Executing command in package router-fastroute removed '.github/FUNDING.yml' ▶ Executing command in package yii-web removed '.github/FUNDING.yml' ▶ Executing command in package view removed '.github/FUNDING.yml' ▶ Executing command in package yii-jquery removed '.github/FUNDING.yml' ▶ Executing command in package yii-masked-input removed '.github/FUNDING.yml' ▶ Executing command in package yii-dataview removed '.github/FUNDING.yml' ▶ Executing command in package yii-debug removed '.github/FUNDING.yml' ▶ Executing command in package yii-gii removed '.github/FUNDING.yml' ▶ Executing command in package yii-bootstrap4 removed '.github/FUNDING.yml' ▶ Executing command in package yii-captcha removed '.github/FUNDING.yml' ▶ Executing command in package yii-auth-client removed '.github/FUNDING.yml' ▶ Executing command in package yii-base-api removed '.github/FUNDING.yml' ▶ Executing command in package yii-base-web removed '.github/FUNDING.yml' ▶ Executing command in package yii-project-template removed '.github/FUNDING.yml' ▶ Executing command in package yii-demo removed '.github/FUNDING.yml' ▶ Executing command in package yii-docker removed '.github/FUNDING.yml' ▶ Executing command in package validator removed '.github/FUNDING.yml' ▶ Executing command in package friendly-exception removed '.github/FUNDING.yml' ▶ Executing command in package template removed '.github/FUNDING.yml' ▶ Executing command in package requirements removed '.github/FUNDING.yml' ```

And then section filesToDelete will not be needed to solve such problems.

samdark commented 4 years ago

Yes. No need for separate command.