/
dimamir
/
revogrid
Обзор
Документация
Войти
/
dimamir
/
revogrid
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
scripts/package-commit.mjs
29 строк
966 B
maks
docs: Updated sponsors section
01 июл 2024, 15:00
01 июл 2024, 15:00
786bfc5
Код
Авторство
О чём код?
import { execa } from 'execa'; import chalk from 'chalk'; import { packageDirs } from './package-dirs.mjs'; async function commitAndPushChanges(packageDir) { try { // Add changes await execa('git', ['add', '.'], { cwd: packageDir, stdio: 'inherit' }); // Commit changes await execa('git', ['commit', '-m', `chore(update): packages synced.`], { cwd: packageDir, stdio: 'inherit' }); // Push changes await execa('git', ['push'], { cwd: packageDir, stdio: 'inherit' }); console.log(chalk.green(`Successfully committed and pushed version updates for ${packageDir} to GitHub`)); } catch (error) { console.error(chalk.red(`Failed to commit and push changes for ${packageDir}`)); console.error(error); } } (async () => { for (const packageDir of packageDirs) { await commitAndPushChanges(packageDir); } console.log(chalk.blue('All changes committed and pushed.')); })();