Commit Graph

26 Commits

Author SHA1 Message Date
Mitchell Hashimoto 02f512d4bd config: new HCL API 2015-11-07 16:53:42 -08:00
Panagiotis Moustafellos e4845f75cc removed extra parentheses 2015-10-08 15:48:04 +03:00
Sander van Harmelen c62370f9e9 Add a function to load JSON directly
Without this 12 line function it’s impossible to use any of the
Terraform code without the need for having the files on disk. As more
and more people are using (parts of) Terraform in other software, this
seems to be a very welcome addition. It has no negative impact on
Terraform itself whatsoever (the function is never called), but it
opens up a lot of other use cases.

Next to the single new function, I renamed the existing function (and
related tests) to better reflect what the function does. So now there
is a `LoadDir` function which calls `LoadFile` for each file, which
kind of made sense to me, especially when now adding a `LoadJSON`
function as well.

But of course if the rename is a problem, I can revert that part as
it’s not related to the added `LoadJSON` function.

Thanks!
2015-06-23 16:15:26 +02:00
Mitchell Hashimoto f84ae29cf8 config: isTemporaryFile -> isIgnoredFile 2015-03-19 09:51:14 +01:00
Radek Simko f794f30b7d Ignore hidden files per Unix conventions 2015-03-18 07:50:33 +00:00
Kushal Pisavadia b40b7ce01a Do not read temporary editor files, fixes #548
This fixes a bug where Terraform would error with the following:

```
Error loading config: Error reading
/Users/rhenrichs/work/example/.#example.tf: open
/Users/rhenrichs/work/example/.#example.tf: no such file or directory
```

The solution implemented here ignores the common emacs and vim
temporary file formats.

Note: the potential danger with merging this is that Terraform could
quickly have requests to ignore other file formats.
2014-12-09 13:15:00 +00:00
Mitchell Hashimoto 6cbadf14df config: IsEmptyDir is true if dir doesn't exist 2014-09-26 16:28:18 -07:00
Mitchell Hashimoto 57c1a8dada config: add IsEmptyDir 2014-09-26 16:04:09 -07:00
Mitchell Hashimoto e96fe43814 config: dir on Config should be an absolute path 2014-09-14 19:55:38 -07:00
Mitchell Hashimoto f8836290da config: not directory that config was loaded from 2014-09-14 19:35:38 -07:00
Mitchell Hashimoto 99a4439359 config: nicer error if dir isn't a dir 2014-07-28 08:34:43 -07:00
Mitchell Hashimoto 77ff9c3a6b config: some docs 2014-07-20 17:54:16 -07:00
Mitchell Hashimoto 06cdd4fa42 config: LoadDir loads override files 2014-07-20 17:52:46 -07:00
Mitchell Hashimoto cf1f3a9e73 config: test that LoadDir doesn't merge 2014-07-19 16:44:23 -07:00
Mitchell Hashimoto 3d67c967aa config: make Merge an exported func 2014-07-18 17:05:22 -07:00
Mitchell Hashimoto 7a01e781ab config: LoadDir with no matching files errors 2014-07-11 21:04:59 -07:00
Mitchell Hashimoto 14b29d0ecd config: LoadDir 2014-07-11 20:15:09 -07:00
Mitchell Hashimoto f22cc62b2c config: better memory management for libucl 2014-05-23 16:30:28 -07:00
Mitchell Hashimoto 04d88b0540 config: move things out into more files 2014-05-23 15:35:18 -07:00
Mitchell Hashimoto c1dea5e5b3 config: comments 2014-05-23 15:32:34 -07:00
Mitchell Hashimoto 218cc80aab config: refactoring to be less libucl-specific 2014-05-23 15:28:19 -07:00
Mitchell Hashimoto 88bb42b5a4 config: loader rename 2014-05-23 15:06:58 -07:00
Mitchell Hashimoto 7cfd360fea config: load the import tree 2014-05-23 15:06:37 -07:00
Mitchell Hashimoto fb9c58f0e2 config: better error message 2014-05-23 11:03:38 -07:00
Mitchell Hashimoto 089822a36f config: some comments 2014-05-23 10:52:19 -07:00
Mitchell Hashimoto ec3f72703c Initial work on config 2014-05-22 16:56:28 -07:00