Skip to content

Commit

Permalink
pake-cli添加Linux appimage格式
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlntin committed Dec 10, 2022
1 parent 43a2740 commit e2c086c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dist-ssr
output
*.msi
*.deb
*.AppImage
*.dmg

package-lock.json
Expand Down
19 changes: 14 additions & 5 deletions bin/builders/LinuxBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,28 @@ Type=Application
arch = process.arch;
}
const debName = `${name}_${tauriConf.package.version}_${arch}.deb`;
const appPath = this.getBuildedAppPath(npmDirectory, debName);
const appPath = this.getBuildedAppPath(npmDirectory, "deb", debName);
const distPath = path.resolve(`${name}.deb`);
await fs.copyFile(appPath, distPath);
await fs.unlink(appPath);


const appImageName = `${name}_${tauriConf.package.version}_${arch}.AppImage`;
const appImagePath = this.getBuildedAppPath(npmDirectory, "appimage", appImageName);
const distAppPath = path.resolve(`${name}.AppImage`);
await fs.copyFile(appImagePath, distAppPath);
await fs.unlink(appImagePath);
logger.success('Build success!');
logger.success('You can find the app installer in', distPath);
logger.success('You can find the deb app installer in', distPath);
logger.success('You can find the Appimage app installer in', distAppPath);
}

getBuildedAppPath(npmDirectory: string, dmgName: string) {
getBuildedAppPath(npmDirectory: string,packageType: string, packageName: string) {
return path.join(
npmDirectory,
'src-tauri/target/release/bundle/deb',
dmgName
'src-tauri/target/release/bundle/',
packageType,
packageName
);
}
}
17 changes: 12 additions & 5 deletions dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,8 @@ var tauri = {
],
shortDescription: "",
targets: [
"deb"
"deb",
"appimage"
]
}
};
Expand Down Expand Up @@ -2115,16 +2116,22 @@ Type=Application
arch = process.arch;
}
const debName = `${name}_${tauriConf.package.version}_${arch}.deb`;
const appPath = this.getBuildedAppPath(npmDirectory, debName);
const appPath = this.getBuildedAppPath(npmDirectory, "deb", debName);
const distPath = path.resolve(`${name}.deb`);
yield fs.copyFile(appPath, distPath);
yield fs.unlink(appPath);
const appImageName = `${name}_${tauriConf.package.version}_${arch}.AppImage`;
const appImagePath = this.getBuildedAppPath(npmDirectory, "appimage", appImageName);
const distAppPath = path.resolve(`${name}.AppImage`);
yield fs.copyFile(appImagePath, distAppPath);
yield fs.unlink(appImagePath);
logger.success('Build success!');
logger.success('You can find the app installer in', distPath);
logger.success('You can find the deb app installer in', distPath);
logger.success('You can find the Appimage app installer in', distAppPath);
});
}
getBuildedAppPath(npmDirectory, dmgName) {
return path.join(npmDirectory, 'src-tauri/target/release/bundle/deb', dmgName);
getBuildedAppPath(npmDirectory, packageType, packageName) {
return path.join(npmDirectory, 'src-tauri/target/release/bundle/', packageType, packageName);
}
}

Expand Down

0 comments on commit e2c086c

Please sign in to comment.