-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from erichlf/update-setup
Update setup
- Loading branch information
Showing
10 changed files
with
252 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
-- Copyright (c) 2024 Erich L Foster | ||
-- | ||
-- | ||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
-- this software and associated documentation files (the "Software"), to deal in | ||
-- the Software without restriction, including without limitation the rights to | ||
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
-- of the Software, and to permit persons to whom the Software is furnished to do | ||
-- so, subject to the following conditions: | ||
-- | ||
-- | ||
-- The above copyright notice and this permission notice shall be included in all | ||
-- copies or substantial portions of the Software. | ||
-- | ||
-- | ||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
-- SOFTWARE. | ||
local log = require("devcontainer-cli.log") | ||
|
||
local ConfigModule = {} | ||
local file_path = debug.getinfo(1).source:sub(2) | ||
|
@@ -28,41 +29,45 @@ local default_config = { | |
-- Folder where the nvim-devcontainer-cli is installed | ||
nvim_plugin_folder = file_path:gsub("init.lua", "") .. "../../../", | ||
-- Remove existing container each time DevcontainerUp is executed | ||
-- If set to True [default_value] it can take extra time as you force to | ||
-- If set to True [default_value] it can take extra time as you force to | ||
-- start from scratch | ||
remove_existing_container = true, | ||
-- dotfiles to be downloaded | ||
dotfiles_repository = "[email protected]:erichlf/dotfiles", | ||
-- branch to checkout for repositories (this is a feature not supported by | ||
-- branch to checkout for repositories (this is a feature not supported by | ||
-- devcontainers in general, but we do) | ||
dotfiles_branch = "main", | ||
-- directory for the setup environment | ||
dotfiles_targetPath = "~/dotfiles", | ||
-- command that's executed for installed the dependencies from the | ||
-- command that's executed for installed the dependencies from the | ||
-- setup_environment_repo | ||
dotfiles_installCommand = "install.sh", | ||
-- The number of columns to wrap text at | ||
terminal_columns = 80, | ||
-- The particular binary to use for connecting to in the devcontainer | ||
-- Most likely this should remain nvim | ||
nvim_binary = "nvim", | ||
-- The shell to use for executing command. Available sh, bash, zsh or any | ||
-- The shell to use for executing command. Available sh, bash, zsh or any | ||
-- other that uses '-c' to signify a command is to follow | ||
shell = 'bash', | ||
} | ||
|
||
local options | ||
|
||
function ConfigModule.setup(opts) | ||
log.debug("Configuring devcontainer-cli") | ||
opts = vim.tbl_deep_extend("force", default_config, opts or {}) | ||
options = opts | ||
log.debug("Configuring devcontainer-cli complete") | ||
end | ||
|
||
return setmetatable(ConfigModule, { | ||
__index = function(_, key) | ||
if options == nil then | ||
return vim.deepcopy(default_config)[key] | ||
end | ||
return options[key] | ||
end, | ||
}) | ||
return setmetatable(ConfigModule, | ||
{ | ||
__index = function(_, key) | ||
if options == nil then | ||
return vim.deepcopy(default_config)[key] | ||
end | ||
return options[key] | ||
end, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.