@pmate/merry-scheduler 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -34,7 +34,7 @@ export function parse(args,env={}){
|
|
|
34
34
|
if(operation==='create'&&!body.source)throw Error('An authorized source is required (--source JSON)')
|
|
35
35
|
return{agent,operation,body}
|
|
36
36
|
}
|
|
37
|
-
export function readSession(app,env){try{return JSON.parse(execFileSync('pmate',['session','read','--app',app],{env,encoding:'utf8',timeout:15000,maxBuffer:32768,stdio:['ignore','pipe','pipe']}))}catch{throw Error(`Unable to read session; run pmate login --app ${app}`)}}
|
|
37
|
+
export function readSession(app,env){try{return JSON.parse(execFileSync('pmate',['session','read','--app',app],{env:{...env,PMATE_SESSION_APP:app,...(env.PCS_AGENT_ID?{PMATE_EXPECTED_PROFILE_ID:env.PCS_AGENT_ID}:{})},encoding:'utf8',timeout:15000,maxBuffer:32768,stdio:['ignore','pipe','pipe']}))}catch{throw Error(`Unable to read session; run pmate login --app ${app}`)}}
|
|
38
38
|
export async function scheduler(args,{env=process.env,fetcher=fetch,session=readSession}={}){
|
|
39
39
|
const parsed=parse(args,env);if(parsed.help)return HELP
|
|
40
40
|
const {agent,operation,body}=parsed,app=env.PMATE_SCHEDULER_APP??(env.PCS_AGENT_ID?'pmate:merry':'pmate:factory')
|
package/manifest.json
CHANGED