@agent8/deploy 1.3.0 → 1.3.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/bin/agent8.js +11 -2
- package/package.json +1 -1
package/bin/agent8.js
CHANGED
|
@@ -154,8 +154,17 @@ const calculateFileHash = (filePath) => {
|
|
|
154
154
|
return crypto.createHash("md5").update(fileContent).digest("hex");
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
// Check for server.js
|
|
158
|
-
|
|
157
|
+
// Check for server.js (priority: ./server.js, fallback: ./server/dist/server.js)
|
|
158
|
+
let serverFilePath = path.resolve(process.cwd(), "server.js");
|
|
159
|
+
if (!fs.existsSync(serverFilePath)) {
|
|
160
|
+
// Fallback to ./server/dist/server.js if ./server.js doesn't exist
|
|
161
|
+
const fallbackPath = path.resolve(process.cwd(), "server/dist/server.js");
|
|
162
|
+
if (fs.existsSync(fallbackPath)) {
|
|
163
|
+
serverFilePath = fallbackPath;
|
|
164
|
+
console.log("Found server file: ./server/dist/server.js");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
159
168
|
if (fs.existsSync(serverFilePath)) {
|
|
160
169
|
// Validate server.js syntax before deployment
|
|
161
170
|
try {
|