This commit is contained in:
aynic.os 2021-05-09 19:27:07 +02:00
parent b76111f017
commit a5ea0292f2
4 changed files with 34 additions and 13 deletions

View File

@ -5,3 +5,5 @@ shellcheck-%:
shellspec-%:
shellspec $*
~/.zen/secret.june:

13
include.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
i_am() {
echo 'v0.4'
}
i_am_root() {
[ $(id -u) -eq 0 ]
}
i_should_install() {
[[ ! -f ~/.zen/secret.june ]]
}

View File

@ -1,13 +1,15 @@
#!/bin/bash
set -x
. ./include.sh
########################################################################
# Version: 0.3
# Version: 0.4
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
{
[ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
i_am_root && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
# MAIN #
if [[ ! -f ~/.zen/secret.june ]];
if i_should_install;
then
# Check requirements

View File

@ -1,15 +1,19 @@
#shellcheck shell=sh
Describe "AstrXbian"
Describe "install()"
install() {
echo #
}
It "installs world, but not implemented"
Pending "You should implement install function"
When call install world
The output should eq "amen"
Describe 'AstrXbian'
Describe 'install()'
Include ./include.sh
It 'should be me'
When call i_am
The output should eq 'v0.4'
End
It 'should not be superuser'
When call i_am_root
The status should not be success
End
It 'should install AstrXbian'
When call i_should_install
The status should be success
End
End
End