Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

First time user feedback - check if draft init has run and remind if haven't #900

Open
CJHarmath opened this issue Nov 21, 2018 · 0 comments

Comments

@CJHarmath
Copy link

Awesome idea, just saw it and took it for a ride on a local cluster and wanted to share my first feedback.

I somehow skipped the draft init part and went straight to download draft untar then tried draft create on the python sample and got this:

$ draft create
--> Draft detected Python (97.267760%)
--> Could not find a pack for Python. Trying to find the next likely language match...
--> Draft detected Text (2.732240%)
--> Could not find a pack for Text. Trying to find the next likely language match...
Error: no languages were detected

There could be a check to see if there was an init by just checking the draft-pack-repo folders and tell the newby user to draft init first.

Something like this ( haven't tested it). Also not sure what other ways like env vars can be used to configure the .draft path...

var ErrNoRepoDetected = errors.New("draft-pack-repo is missing, run draft init first!")

repoExists, err := osutil.Exists(filepath.Join(os.Getenv("HOME"), ".draft/plugins/draft-pack-repo"))
	if err != nil {
		return fmt.Errorf("there was an error checking if draft-pack-repo/ exists: %v", err)
	}
	if !repoExists {
		// missing draft init
		return "", ErrNoRepoDetected
	}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants