Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and astrobot-houston committed Jan 12, 2023
1 parent 309dfb0 commit bbb14d7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/notify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const extraVerbs = [
'live now',
'hot and fresh',
'for you',
'comin\' atcha',
]
"comin' atcha",
];

function item(items) {
return items[Math.floor(Math.random() * items.length)];
Expand Down Expand Up @@ -120,7 +120,9 @@ async function run() {

if (packages.length === 1) {
const { name, version, url } = packages[0];
message += `${emoji} \`${name}@${version}\` ${singularlize(verb)}\nRead the [release notes →](<${url}>)\n`
message += `${emoji} \`${name}@${version}\` ${singularlize(
verb
)}\nRead the [release notes →](<${url}>)\n`;
} else {
message += `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;
for (const { name, version, url } of packages) {
Expand All @@ -131,13 +133,13 @@ async function run() {
if (message.length < 2000) {
console.log(message);
} else {
const { name, version, url } = packages.find(pkg => pkg.name === 'astro') ?? packages[0];
const { name, version, url } = packages.find((pkg) => pkg.name === 'astro') ?? packages[0];
message = `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;
message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`
message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`;

message += `\nAlso ${item(extraVerbs)}:`
message += `\nAlso ${item(extraVerbs)}:`;

const remainingPackages = packages.filter(p => p.name !== name);
const remainingPackages = packages.filter((p) => p.name !== name);
for (const { name, version, url } of remainingPackages) {
message += `\n• \`${name}@${version}\``;
}
Expand All @@ -146,7 +148,7 @@ async function run() {
console.log(message);
} else {
message = `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;
message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`
message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`;

message += `\n\nAlso ${item(extraVerbs)}: ${remainingPackages.length} other packages!`;
console.log(message);
Expand Down

0 comments on commit bbb14d7

Please sign in to comment.