Skip to content

Commit

Permalink
Clean up - Prelude script has everything we need
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyMoud committed Sep 20, 2024
1 parent 08c7c6f commit 94a2944
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
8 changes: 1 addition & 7 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var initCmd = &cobra.Command{
os.Exit(0)
}

// init the sidekick system config
// init the sidekick system config && add public key to known_hosts
preludeCmd := exec.Command("sh", "-s", "-", server)
preludeCmd.Stdin = strings.NewReader(utils.PreludeScript)
if preludeCmdErr := preludeCmd.Run(); preludeCmdErr != nil {
Expand All @@ -98,12 +98,6 @@ var initCmd = &cobra.Command{
viper.Set("dockerUsername", dockerUsername)
viper.Set("certEmail", certEmail)

keyAddSshCommand := exec.Command("sh", "-s", "-", server)
keyAddSshCommand.Stdin = strings.NewReader(utils.SshKeysScript)
if sshAddErr := keyAddSshCommand.Run(); sshAddErr != nil {
panic(sshAddErr)
}

multi := pterm.DefaultMultiPrinter
setupProgressBar, _ := pterm.DefaultProgressbar.WithTotal(6).WithWriter(multi.NewWriter()).Start("Sidekick Booting up (2m estimated) ")
rootLoginSpinner, _ := utils.GetSpinner().WithWriter(multi.NewWriter()).Start("Logging into with root")
Expand Down
11 changes: 0 additions & 11 deletions utils/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ limitations under the License.
*/
package utils

var SshKeysScript = `
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <hostname>"
exit 1
fi
HOSTNAME=$1
ssh-keyscan -H $HOSTNAME >> ~/.ssh/known_hosts
`

var DockerHandleScript = `
appName=$1
dockerUsername=$2
Expand Down

0 comments on commit 94a2944

Please sign in to comment.