File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -15,18 +15,26 @@ import {
1515 kPublishProviders ,
1616 PublishProvider ,
1717} from "../../publish/provider.ts" ;
18+ import { PublishRecord } from "../../publish/types.ts" ;
1819
1920export type AccountPrompt = "always" | "never" | "multiple" ;
2021
2122export async function resolveAccount (
2223 provider : PublishProvider ,
2324 prompt : AccountPrompt ,
25+ target ?: PublishRecord ,
2426) {
2527 // see what tyep of token we are going to use
2628 let token : AccountToken | undefined ;
2729
2830 // build list of account options
29- const accounts = await provider . accountTokens ( ) ;
31+ const accounts = ( await provider . accountTokens ( ) ) . filter ( ( account ) => {
32+ if ( account . server && target ?. url ) {
33+ return target . url . startsWith ( account . server ) ;
34+ } else {
35+ return true ;
36+ }
37+ } ) ;
3038
3139 // if we aren't prompting then we need to have one at the ready
3240 if ( prompt === "never" ) {
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ async function publishAction(
110110 const account = await resolveAccount (
111111 publishProvider ,
112112 publishOptions . prompt ? accountPrompt : "never" ,
113+ publishTarget ,
113114 ) ;
114115 if ( account ) {
115116 await publish (
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ import { pandocAutoIdentifier } from "../../core/pandoc/pandoc-id.ts";
3131import { contentName } from "../publish.ts" ;
3232import { createTempContext } from "../../core/temp.ts" ;
3333import { createBundle } from "./bundle.ts" ;
34- import { sleep } from "../../core/wait.ts" ;
3534
3635export const kRSConnect = "rsconnect" ;
3736const kRSConnectDescription = "RS Connect" ;
@@ -227,7 +226,6 @@ async function publish(
227226 content = await createContent ( client , type , title ) ;
228227 if ( content ) {
229228 target = { id : content . guid , url : content . content_url , code : false } ;
230- console . log ( content ) ;
231229 } else {
232230 throw new Error ( ) ;
233231 }
You can’t perform that action at this time.
0 commit comments