<commit_before>/**
 * Copyright (C) 2015 Red Hat, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cmds

import (
	"errors"
	"os"
	"os/exec"
	"runtime"
	"strings"
	"time"

	"github.com/fabric8io/gofabric8/util"
	"github.com/kardianos/osext"
	"github.com/spf13/cobra"
	client "k8s.io/kubernetes/pkg/client/unversioned"
	cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
	"path/filepath"
)

const (
	memory  = "memory"
	cpus    = "cpus"
	console = "console"
)

// NewCmdStart starts a local cloud environment
func NewCmdStart(f *cmdutil.Factory) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "start",
		Short: "Starts a local cloud development environment",
		Long:  `Starts a local cloud development environment`,

		Run: func(cmd *cobra.Command, args []string) {

			flag := cmd.Flags().Lookup(minishift)
			isOpenshift := false
			if flag != nil {
				isOpenshift = flag.Value.String() == "true"
			}

			if !isInstalled(isOpenshift) {
				install(isOpenshift)
			}

			if isOpenshift {
				kubeBinary = minishift
			}

			binaryFile := resolveBinaryLocation(kubeBinary)

			// check if already running
			out, err := exec.Command(binaryFile, "status").Output()
			if err != nil {
				util.Fatalf("Unable to get status %v", err)<commit_msg>lets check that we search for minikube.exe on windows<commit_after>/**
 * Copyright (C) 2015 Red Hat, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cmds

import (
	"errors"
	"os"
	"os/exec"
	"runtime"
	"strings"
	"time"

	"github.com/fabric8io/gofabric8/util"
	"github.com/kardianos/osext"
	"github.com/spf13/cobra"
	client "k8s.io/kubernetes/pkg/client/unversioned"
	cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
	"path/filepath"
)

const (
	memory  = "memory"
	cpus    = "cpus"
	console = "console"
)

// NewCmdStart starts a local cloud environment
func NewCmdStart(f *cmdutil.Factory) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "start",
		Short: "Starts a local cloud development environment",
		Long:  `Starts a local cloud development environment`,

		Run: func(cmd *cobra.Command, args []string) {

			flag := cmd.Flags().Lookup(minishift)
			isOpenshift := false
			if flag != nil {
				isOpenshift = flag.Value.String() == "true"
			}

			if !isInstalled(isOpenshift) {
				install(isOpenshift)
			}

			if isOpenshift {
				kubeBinary = minishift
			}

			if runtime.GOOS == "windows" && !strings.HasSuffix(kubeBinary, ".exe") {
				kubeBinary += ".exe"
			}

			binaryFile := resolveBinaryLocation(kubeBinary)

			// check if already running
			out, err := exec.Command(binaryFile, "status").Output()
			if err != nil {
				util.Fatalf("Unable to get status %v", err)
{'fraction_non_alphanumeric': 0.11718538565629229, 'fraction_numerical': 0.007577807848443843, 'mean_word_length': 3.557336621454994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3162978', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1210, 'n_words': 370}