Skip to content

Commit ea9586e

Browse files
committed
ritocchi
1 parent 39c3d81 commit ea9586e

2 files changed

Lines changed: 28 additions & 18 deletions

File tree

pods/podman.command.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ PENGUINS_EGGS_ARCH="penguins-eggs-10.1.*-*-any.pkg.tar.zst "
4343
PENGUINS_EGGS_DEB="penguins-eggs_10.1.*-*_amd64.deb"
4444
PENGUINS_EGGS_TARBALLS=penguins-eggs_10.1.*-*-linux-x64.tar.gz
4545

46-
# rm -f $CMD_PATH/./ci/$PENGUINS_EGGS_ARCH
47-
# rm -f $CMD_PATH/./ci/$PENGUINS_EGGS_DEB
48-
# rm -f $CMD_PATH/./ci/$PENGUINS_EGGS_TARBALLS
46+
rm -f $CMD_PATH/./ci/$PENGUINS_EGGS_ARCH
47+
rm -f $CMD_PATH/./ci/$PENGUINS_EGGS_DEB
48+
rm -f $CMD_PATH/./ci/$PENGUINS_EGGS_TARBALLS
4949

5050
if [ -f /etc/os-release ]; then
5151
. /etc/os-release

src/commands/pods.ts

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Utils from '../classes/utils.js'
1212
import { exec } from '../lib/utils.js'
1313
import path from 'node:path'
1414

15+
1516
// _dirname
1617
const __dirname = path.dirname(new URL(import.meta.url).pathname)
1718

@@ -36,37 +37,46 @@ export default class Pods extends Command {
3637
*/
3738
async run(): Promise<void> {
3839
Utils.titles(this.id + ' ' + this.argv)
39-
40+
4041
const { args, flags } = await this.parse(Pods)
4142

4243
if (process.getuid && process.getuid() === 0) {
4344
Utils.warning('You must use eggs pods without sudo')
4445
process.exit(0)
4546
}
4647

47-
// Create pods if not exists
48-
const userHome=`/home/${await Utils.getPrimaryUser()}/`
49-
if (!fs.existsSync(`${userHome}/pods`)) {
50-
console.log(`creating pods folder in ${userHome}`)
51-
const source = Utils.rootPenguin() + '/pods'
52-
await exec(`cp -r ${source} ${userHome}`)
53-
}
54-
55-
let distro='debian'
56-
if (this.argv['0'] !== undefined) {
57-
distro = this.argv['0']
48+
const userHome = `/home/${await Utils.getPrimaryUser()}/`
49+
if (!Utils.isSources()) {
50+
// Create pods in home, if not exists
51+
if (!fs.existsSync(`${userHome}/pods`)) {
52+
if (await Utils.customConfirm()) {
53+
console.log(`Creating pods folder in ${userHome}`)
54+
await exec(`cp -r ${Utils.rootPenguin()}/pods ${userHome}`)
55+
} else {
56+
process.exit(0)
57+
}
58+
}
5859
}
5960

6061
let pathPods = path.resolve(__dirname, `../../pods`)
6162
if (Utils.rootPenguin() === '/usr/lib/penguins-eggs') {
6263
pathPods = path.resolve(`${userHome}/pods`)
6364
}
64-
let cmd =`${pathPods}/${distro}.sh`
6565

66+
let distro = 'debian'
67+
if (this.argv['0'] !== undefined) {
68+
distro = this.argv['0']
69+
}
70+
71+
let cmd = `${pathPods}/${distro}.sh`
6672
if (fs.existsSync(cmd)) {
67-
await exec(cmd)
73+
console.log(`We are building a egg from a ${distro} container`)
74+
if (! await Utils.customConfirm()) {
75+
process.exit(0)
76+
}
77+
await exec(cmd)
6878
} else {
69-
console.log(`script: ${cmd} not exists`)
79+
console.log(`No script: ${cmd} fpr ${distro} container`)
7080
}
7181
}
7282
}

0 commit comments

Comments
 (0)