Skip to content

Instantly share code, notes, and snippets.

@webarchitect609
Last active February 12, 2021 10:05
Show Gist options
  • Save webarchitect609/bda2c9d8af78111951d6fcd318047066 to your computer and use it in GitHub Desktop.
Save webarchitect609/bda2c9d8af78111951d6fcd318047066 to your computer and use it in GitHub Desktop.
Convert a list of composer packages from composer.json to the `composer install` command line arguments
# Find
("[^"]+":)\s+("[^"]+")\n
# Replace(with the space at the end!)
$1$2
# Example
# Before:
"adv/bitrix-coupon-lock": "^0.1.8"
"adv/bitrix-discounts": "^2.0"
"webarchitect609/bitrix-cache": "1.9.2"
"webarchitect609/bitrix-user-type": "0.7.3"
"yriveiro/php-backoff": "2.1.1"
# After:
"adv/bitrix-coupon-lock":"^0.1.8" "adv/bitrix-discounts":"^2.0" "webarchitect609/bitrix-cache":"1.9.2" "webarchitect609/bitrix-user-type":"0.7.3" "yriveiro/php-backoff":"2.1.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment