diff --git a/packages/load-application/package.json b/packages/load-application/package.json index ba7f743..4bef8f9 100644 --- a/packages/load-application/package.json +++ b/packages/load-application/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/load-application", - "version": "0.0.13-beta.4", + "version": "0.0.13-beta.5", "description": "load application for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/load-application/src/utils/index.ts b/packages/load-application/src/utils/index.ts index 6075a08..7ab83c2 100644 --- a/packages/load-application/src/utils/index.ts +++ b/packages/load-application/src/utils/index.ts @@ -1,4 +1,4 @@ -import { endsWith, keys, replace } from 'lodash'; +import { endsWith, keys, replace, split } from 'lodash'; import { RANDOM_PATTERN, REGISTRY, GITHUB_REGISTRY } from '../constant'; import Credential from '@serverless-devs/credential'; @@ -12,6 +12,9 @@ export const tryfun = async (fn: Function, ...args: any[]) => { export const getUrlWithLatest = (name: string) => { if (REGISTRY.CUSTOM_URL === GITHUB_REGISTRY) { + if (split(name, '/').length === 1) { + return `${REGISTRY.CUSTOM_URL}/devsapp/${name}`; + } return `${REGISTRY.CUSTOM_URL}/${name}`; } return `${REGISTRY.V3}/packages/${name}/release/latest`