Skip to content

Commit

Permalink
additional logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-rosianu committed Apr 1, 2024
1 parent 29c2644 commit b107ace
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions action/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -188169,11 +188169,12 @@ const robot = (app) => {
const tokensDirectories = (response.data && response.data.length) ? response.data : [];
const subdirectoriesWithSameTicker = tokensDirectories.filter((content) => content?.type === "dir" && content?.name?.startsWith(tokenTicker));
if (subdirectoriesWithSameTicker.length) {
if (subdirectoriesWithSameTicker[0].name === tokenName) {
const existingToken = subdirectoriesWithSameTicker[0].name;
if (existingToken === tokenName) {
// it's just an update to the same token
return;
}
await fail(`Token with ticker ${tokenTicker} already exists!`);
await fail(`Token with ticker ${tokenTicker} already exists! Existing token id=${existingToken}. New token id=${tokenName}`);
}
}
async function fail(reason) {
Expand Down
5 changes: 3 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ export const robot = (app: Probot) => {
);

if (subdirectoriesWithSameTicker.length) {
if (subdirectoriesWithSameTicker[0].name === tokenName) {
const existingToken = subdirectoriesWithSameTicker[0].name;
if (existingToken === tokenName) {
// it's just an update to the same token
return;
}

await fail(`Token with ticker ${tokenTicker} already exists!`);
await fail(`Token with ticker ${tokenTicker} already exists! Existing token id=${existingToken}. New token id=${tokenName}`);
}
}

Expand Down

0 comments on commit b107ace

Please sign in to comment.