|
1 | | -import fs from "fs"; |
2 | 1 | import path from "path"; |
3 | 2 | import { execa } from "execa"; |
4 | | -// We'll call the CLI directly for icon handling |
5 | 3 |
|
6 | 4 | // Configuration logging |
7 | 5 | const logConfiguration = () => { |
@@ -80,59 +78,7 @@ const main = async () => { |
80 | 78 | const timeout = 900000; // 15 minutes for all builds |
81 | 79 | await execa("node", params, { stdio: "inherit", timeout }); |
82 | 80 |
|
83 | | - // Create output directory if it doesn't exist |
84 | | - if (!fs.existsSync("output")) { |
85 | | - fs.mkdirSync("output"); |
86 | | - } |
87 | | - |
88 | | - // Move built files to output directory more efficiently |
89 | | - const buildPaths = [ |
90 | | - `src-tauri/target/release/bundle`, |
91 | | - `src-tauri/target/universal-apple-darwin/release/bundle`, |
92 | | - ]; |
93 | | - |
94 | | - for (const buildPath of buildPaths) { |
95 | | - if (fs.existsSync(buildPath)) { |
96 | | - const bundleFiles = fs |
97 | | - .readdirSync(buildPath, { recursive: true }) |
98 | | - .filter((file) => { |
99 | | - const fullPath = path.join(buildPath, file); |
100 | | - return ( |
101 | | - fs.statSync(fullPath).isFile() && |
102 | | - (file.endsWith(".dmg") || |
103 | | - file.endsWith(".exe") || |
104 | | - file.endsWith(".deb") || |
105 | | - file.endsWith(".rpm") || |
106 | | - file.endsWith(".AppImage")) |
107 | | - ); |
108 | | - }); |
109 | | - |
110 | | - for (const file of bundleFiles) { |
111 | | - const srcPath = path.join(buildPath, file); |
112 | | - const destPath = path.join("output", path.basename(file)); |
113 | | - // Use fs.copyFileSync for cross-platform compatibility |
114 | | - fs.copyFileSync(srcPath, destPath); |
115 | | - } |
116 | | - break; // Found files, no need to check other paths |
117 | | - } |
118 | | - } |
119 | | - |
120 | | - // Fallback to original method if no bundle files found |
121 | | - const files = fs.readdirSync("."); |
122 | | - const namePattern = new RegExp(`^${process.env.NAME}\\..*$`); |
123 | | - let foundFiles = false; |
124 | | - for (const file of files) { |
125 | | - if (namePattern.test(file)) { |
126 | | - // Use fs for cross-platform file operations |
127 | | - const destPath = path.join("output", file); |
128 | | - fs.renameSync(file, destPath); |
129 | | - foundFiles = true; |
130 | | - } |
131 | | - } |
132 | | - |
133 | | - if (!foundFiles) { |
134 | | - console.log("Warning: No output files found matching pattern"); |
135 | | - } |
| 81 | + // pake-cli will handle file output to its own output directory |
136 | 82 |
|
137 | 83 | console.log("Build Success"); |
138 | 84 | process.chdir("../.."); |
|
0 commit comments