Skip to content

Commit

Permalink
feat: add NPM_REGISTRY support
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Jul 23, 2024
1 parent 12088ca commit cbcd102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion initiation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const GRAPH_API_ENDPOINT = process.env.GRAPH_API_ENDPOINT;
const GRAPH_CLIENT_ENDPOINT = process.env.GRAPH_CLIENT_ENDPOINT;
const SDK_RELEASE_TYPE = process.env.SDK_RELEASE_TYPE;
const SDK_RELEASE_REGISTRY = process.env.SDK_RELEASE_REGISTRY;
const NPM_REGISTRY = process.env.NPM_REGISTRY;

if (!SDK_PACKAGE_NAME) {
console.error('env SDK_PACKAGE_NAME is required')
Expand All @@ -36,10 +37,14 @@ if (!GRAPH_CLIENT_ENDPOINT) {

let version = '1.0.0';
try {
const preVersion = await $`npm view ${SDK_PACKAGE_NAME} version`;
const preVersion = await $`npm view ${SDK_PACKAGE_NAME || 'antd'} version${NPM_REGISTRY ? ` --registry ${NPM_REGISTRY}` : ''}`;
console.log(preVersion)
version = semver.inc(preVersion.stdout || '1.0.0', SDK_RELEASE_TYPE || 'patch');
} catch (error) {
console.error(`failed to view ${SDK_PACKAGE_NAME} version`)
if (!error.message.includes('404')) {
process.exit(1)
}
}

fs.writeFileSync(
Expand Down
2 changes: 1 addition & 1 deletion src/errors/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Modal, { type ModalFuncProps } from 'antd/es/modal';
import { GraphQLError } from 'graphql-request/src/types';

export const logout = () => {
window.location.href = '/logout';
window.location.href = '/oidc/logout';
};

let InvalidTokenModal:
Expand Down

0 comments on commit cbcd102

Please sign in to comment.