8

Let's say I have a folder with some .hs files and I want to wrap it in a project

If I have cabal install and stack it's no big deal:

  • use cabal init (interactive choosing stuff)
  • go on with stack init

but when I just go the easy - just install stack route I don't have cabal install available - only stack

Now stack init does not work without a .cabal (or .package) file and for stack new I know of no template that does not set up additional files/folders.

Probably I'm missing something obvious and there is a stack parameter/command for this?

If not: What's the proper way to handle this? Install cabal-install?

Random Dev
  • 51,810
  • 9
  • 92
  • 119
  • 1
    I'm not aware of a `stack` command similar to `cabal init`. Either install `cabal-install`, then `cabal init` and `stack init`, or `stack new` and move the files into the fresh project. – sjakobi Jan 12 '17 at 07:31
  • yes that's what I thought ... to you think I should oben a issue with a request for this feature (not sure if many will find it useful) – Random Dev Jan 12 '17 at 16:00
  • actually just installing `cabal-install` via stack will not work as the `cabal` executable is dependent on a certain GHC and it will not find it in that env. ... well `stack new` here we go – Random Dev Jan 12 '17 at 16:07
  • Sure, you can open a feature request. It may not be implemented right away but others who look for the same thing can then give their `+1`s and it may turn out that more people than expected would find it useful. – sjakobi Jan 12 '17 at 21:18
  • Regarding `cabal init`, you can run `stack exec -- cabal init` to run `cabal` in `stack`'s GHC environment. – sjakobi Jan 12 '17 at 21:20
  • I thought so too - but it will not work with `stack exec -- cabal init` cannot reproduce right now (wrong system) but you'll get some error - but thank you for your time - if you add it as an answer I'll mark it – Random Dev Jan 13 '17 at 07:48
  • 3
    `stack exec --no-ghc-package-path -- cabal init` should work. – sjakobi Jan 13 '17 at 20:06
  • @sjakobi indeed it does - thank you! - can you turn this into an answer? – Random Dev Jan 14 '17 at 17:05

0 Answers0