forked from josip/eerie
-
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.
Created new proto for Transaction actions. Moved most of setup.io cod…
…e to hooks/beforeInstall.io
- Loading branch information
Showing
18 changed files
with
295 additions
and
212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env io | ||
|
||
Eerie Env named("default") activate | ||
|
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env io | ||
|
||
homePath := User homeDirectory path | ||
eeriePath := homePath .. "/.eerie" | ||
eerieDir := Directory with(eeriePath) | ||
|
||
appendEnvVariables := method( | ||
# select() should eliminate symlinks | ||
bashFiles := list("bashrc", "profile", "bash_profile") map(f, | ||
Path with(homePath, "/." .. f)) select(p, File with(p) isRegularFile) | ||
|
||
bashScript := """| | ||
|# Four Commandments of Eerie | ||
|EERIEDIR=#{eeriePath} | ||
|PATH=$PATH:$EERIEDIR/base/bin:$EERIEDIR/activeEnv/bin | ||
|export EERIEDIR PATH | ||
|# That's all folks""" fixMultiline interpolate | ||
|
||
bashFiles foreach(path, | ||
f := File with(path) openForAppending | ||
f contents containsSeq("EERIEDIR") ifFalse( | ||
f appendToContents(bashScript)) | ||
f close)) | ||
|
||
appendAddonLoaderPaths := method( | ||
iorc := File with(homePath .. "/.iorc") | ||
iorc exists ifFalse(iorc create) | ||
loaderCode := """ | ||
AddonLoader appendSearchPath(System getEnvironmentVariable("EERIEDIR") .. "/base/addons") | ||
AddonLoader appendSearchPath(System getEnvironmentVariable("EERIEDIR") .. "/activeEnv)""" | ||
|
||
iorc openForAppending contents containsSeq("EERIEDIR") ifFalse( | ||
iorc appendToContents(loaderCode .. "\n")) | ||
iorc close | ||
|
||
System setEnvironmentVariable("EERIEDIR", eeriePath)) | ||
|
||
createDirectories := method( | ||
eerieDir create | ||
eerieDir directoryNamed("env") create | ||
eerieDir directoryNamed("tmp") create | ||
|
||
eerieDir fileNamed("/config.json")\ | ||
create openForUpdating write("{\"envs\": {}}") close) | ||
|
||
createDefaultEnvs := method( | ||
baseEnv := Eerie Env with("_base") create activate use | ||
Eerie sh("ln -s #{baseEnv path} #{eeriePath}/base" interpolate) | ||
|
||
Eerie Env with("_plugins") create | ||
Eerie Env with("default") create | ||
Eerie saveConfig) | ||
|
||
Sequence fixMultiline := method( | ||
self splitNoEmpties("\n") map(split("|") last) join("\n") strip) | ||
|
||
eerieDir exists ifFalse( | ||
appendEnvVariables | ||
appendAddonLoaderPaths | ||
createDirectories | ||
createDefaultEnvs) | ||
|
||
|
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
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.