Skip to content

Commit

Permalink
Fixing checkOwner and publish logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptiklemur committed Apr 21, 2023
1 parent d6da42a commit 1603ca7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "node tools/scripts/publish.mjs 3mf-parser {args.ver} {args.tag}"
"command": "node tools/scripts/publish.js @node-bambu/core {args.ver} {args.tag}"
},
"dependsOn": ["build"]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/discord/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "node tools/scripts/publish.mjs 3mf-parser {args.ver} {args.tag}"
"command": "node tools/scripts/publish.js @node-bambu/discord {args.ver} {args.tag}"
},
"dependsOn": ["build"]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/discord/src/Service/InteractionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class InteractionHandler {
}

private checkOwner(interaction: ButtonInteraction, { printer: { owners } }: BambuRepositoryItem) {
return owners.includes(interaction.user.id);
return owners.map((x) => x.id).includes(interaction.user.id);
}

private async changeSpeed(interaction: ButtonInteraction, printer: BambuRepositoryItem, speedUp: boolean) {
Expand Down
8 changes: 4 additions & 4 deletions tools/scripts/publish.mjs → tools/scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* You might need to authenticate with NPM before running this script.
*/

import { readCachedProjectGraph } from '@nrwl/devkit';
import { execSync } from 'child_process';
import { readFileSync, writeFileSync } from 'fs';
import chalk from 'chalk';
const { readCachedProjectGraph } = require('@nrwl/devkit');
const { execSync } = require('node:child_process');
const { readFileSync, writeFileSync } = require('node:fs');
const chalk = require('chalk');

function invariant(condition, message) {
if (!condition) {
Expand Down

0 comments on commit 1603ca7

Please sign in to comment.