1- import path from 'path' ;
2- import { executeAndHandleError } from "../../services/error-handler" ;
3- import { ensureUserIsLoggedIn } from "../../commands/login" ;
4- import { getPlatformConfig , getPlatformExtensionsDir } from "../../services/platform" ;
51import fs from 'fs-extra' ;
6- import { uploadExtension } from "../../commands/push" ;
7- import { publishExtension } from "../../commands/publish" ;
8- import { updateExtension , getInstallation , installExtension } from "../../clients/app-manager" ;
9- import confirmer from "../../services/confirmer" ;
10- import { getExtension } from "../../clients/extension-manager" ;
2+ import path from 'path' ;
3+
4+ import confirmer from '../../services/confirmer' ;
5+ import { executeAndHandleError } from '../../services/error-handler' ;
6+ import { getPlatformConfig , getPlatformExtensionsDir } from '../../services/platform' ;
7+ import { ensureUserIsLoggedIn } from '../../commands/login' ;
8+ import { uploadExtension } from '../../commands/push' ;
9+ import { publishExtension } from '../../commands/publish' ;
10+ import { updateExtension , getInstallation , installExtension } from '../../clients/app-manager' ;
11+ import { getExtension } from '../../clients/extension-manager' ;
1112
1213export const description = 'Publish an extension from the app in the working directory' ;
1314export const command = 'publish <name>' ;
14- export const builder = yargs => {
15- return yargs
16- . usage ( `shoutem ${ command } \n\n${ description } ` ) ;
17- } ;
15+ export const builder = yargs => yargs . usage ( `shoutem ${ command } \n\n${ description } ` ) ;
1816
1917export async function offerInstallationUpdate ( extensionId , extensionName , newVersion ) {
2018 const { appId } = getPlatformConfig ( ) ;
@@ -23,7 +21,10 @@ export async function offerInstallationUpdate(extensionId, extensionName, newVer
2321 const canonical = `${ dev . name } .${ extensionName } ` ;
2422
2523 try {
26- const { id : installationId , extension : oldExtensionId } = await getInstallation ( appId , canonical ) ;
24+ const {
25+ id : installationId ,
26+ extension : oldExtensionId ,
27+ } = await getInstallation ( appId , canonical ) ;
2728 const { version : oldVersion } = await getExtension ( oldExtensionId ) ;
2829
2930 const versionMsg = `${ canonical } @${ oldVersion } => @${ newVersion } ` ;
@@ -43,7 +44,7 @@ export async function offerInstallationUpdate(extensionId, extensionName, newVer
4344 }
4445}
4546
46- async function publish ( name ) {
47+ async function publish ( name ) {
4748 const dev = await ensureUserIsLoggedIn ( ) ;
4849 const extensionPath = path . join ( getPlatformExtensionsDir ( ) , `${ dev . name } .${ name } ` ) ;
4950
@@ -57,4 +58,4 @@ async function publish (name) {
5758 console . log ( 'Success' . green . bold ) ;
5859}
5960
60- export const handler = ( { name } ) => executeAndHandleError ( publish , name ) ;
61+ export const handler = ( { name } ) => executeAndHandleError ( publish , name ) ;
0 commit comments