sessioncast-cli 2.4.0 → 2.4.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/dist/agent/runner.js +27 -1
- package/dist/index.js +0 -0
- package/package.json +1 -1
package/dist/agent/runner.js
CHANGED
|
@@ -120,7 +120,33 @@ class AgentRunner {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
if (!finalPath || !fs.existsSync(finalPath)) {
|
|
123
|
-
|
|
123
|
+
const isLoggedIn = (0, config_1.getAccessToken)() || (0, config_1.getAgentToken)();
|
|
124
|
+
if (isLoggedIn) {
|
|
125
|
+
// User is logged in but agent token not yet generated
|
|
126
|
+
throw new Error('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
|
|
127
|
+
' Agent token not yet generated\n' +
|
|
128
|
+
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n' +
|
|
129
|
+
' Please run `sessioncast login` again to generate an agent token.\n\n' +
|
|
130
|
+
' Or create a config file manually:\n' +
|
|
131
|
+
' $ cat > ~/.sessioncast.yml << \'EOF\'\n' +
|
|
132
|
+
' machineId: my-machine\n' +
|
|
133
|
+
' relay: wss://relay.sessioncast.io/ws\n' +
|
|
134
|
+
' token: agt_YOUR_TOKEN\n' +
|
|
135
|
+
' EOF\n\n' +
|
|
136
|
+
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
137
|
+
}
|
|
138
|
+
throw new Error('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
|
|
139
|
+
' Not logged in\n' +
|
|
140
|
+
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n' +
|
|
141
|
+
' Please login first:\n' +
|
|
142
|
+
' $ sessioncast login\n\n' +
|
|
143
|
+
' Or create a config file manually:\n' +
|
|
144
|
+
' $ cat > ~/.sessioncast.yml << \'EOF\'\n' +
|
|
145
|
+
' machineId: my-machine\n' +
|
|
146
|
+
' relay: wss://relay.sessioncast.io/ws\n' +
|
|
147
|
+
' token: agt_YOUR_TOKEN\n' +
|
|
148
|
+
' EOF\n\n' +
|
|
149
|
+
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
124
150
|
}
|
|
125
151
|
console.log(`Loading config from: ${finalPath}`);
|
|
126
152
|
const content = fs.readFileSync(finalPath, 'utf-8');
|
package/dist/index.js
CHANGED
|
File without changes
|