mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
rename from embassy-sdk to start-sdk and embassy-publish to registr-publish
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -30,6 +30,7 @@ version
|
||||
**/*.s9pk
|
||||
**/appmgr
|
||||
0.3.0_features.md
|
||||
**/start-sdk
|
||||
**/embassy-sdk
|
||||
start9-registry.prof
|
||||
start9-registry.hp
|
||||
|
||||
2
Makefile
2
Makefile
@@ -5,4 +5,4 @@ profile:
|
||||
cabal:
|
||||
cabal build
|
||||
# this step is specific for m1 devices ie. aarch64-osx
|
||||
sudo cp dist-newstyle/build/aarch64-osx/ghc-9.2.5/start9-registry-0.2.1/x/embassy-publish/build/embassy-publish/embassy-publish /usr/local/bin/
|
||||
sudo cp dist-newstyle/build/aarch64-osx/ghc-9.2.5/start9-registry-0.2.1/x/registry-publish/build/registry-publish/registry-publish /usr/local/bin/
|
||||
|
||||
10
README.md
10
README.md
@@ -23,13 +23,13 @@ cd registry
|
||||
```
|
||||
- run `make`
|
||||
|
||||
### Set up embassy-publish tool
|
||||
### Set up registry-publish tool
|
||||
|
||||
- run `apt install libgmp-dev zlib1g-dev libtinfo-dev libpq-dev` (on macOS `brew install libmpd zlib-ng libtiff`)
|
||||
- run `stack install` (recommended: include the installation path in your $PATH after running this command)
|
||||
- update your shell to include the installation path of the copied executables from `stack install`. i.e. `nano ~./zshrc` add `export PATH=$PATH:/your/path/here` to zshrc; save and exit nano. Run `source ~/.zshrc`
|
||||
- run `embassy-publish init --bash` (or --zsh / --fish depending on your preferred shell)
|
||||
- run `embassy-publish reg add -l <URL> -n <NAME> -u <USER> -p <PASS>` (include https:// in your URL)
|
||||
- run `registry-publish init --bash` (or --zsh / --fish depending on your preferred shell)
|
||||
- run `registry-publish reg add -l <URL> -n <NAME> -u <USER> -p <PASS>` (include https:// in your URL)
|
||||
- take the hash that is emitted by this command and submit it to the registry owner
|
||||
|
||||
### Setting up a registry dev environment
|
||||
@@ -40,8 +40,8 @@ cd registry
|
||||
- set PG_PASSWORD to the password for that user
|
||||
- set SSL_AUTO to false
|
||||
- set RESOURCES_PATH to an empty directory you wish to use as your package repository
|
||||
- install `embassy-sdk`
|
||||
- set STATIC_BIN to the path that contains `embassy-sdk`
|
||||
- install `start-sdk`
|
||||
- set STATIC_BIN to the path that contains `start-sdk`
|
||||
|
||||
## APIs
|
||||
|
||||
|
||||
2
hie.yaml
2
hie.yaml
@@ -7,4 +7,4 @@ cradle:
|
||||
- path: "./test"
|
||||
component: "start9-registry:test:start9-registry-test"
|
||||
- path: "./cli"
|
||||
component: "start9-registry:exe:embassy-publish"
|
||||
component: "start9-registry:exe:registry-publish"
|
||||
|
||||
@@ -111,7 +111,7 @@ executables:
|
||||
when:
|
||||
- condition: flag(library-only)
|
||||
buildable: false
|
||||
embassy-publish:
|
||||
registry-publish:
|
||||
source-dirs: cli
|
||||
main: Main.hs
|
||||
ghc-options:
|
||||
|
||||
@@ -270,7 +270,7 @@ cfgLocation = getHomeDirectory <&> \d -> d </> ".embassy/publish.dhall"
|
||||
|
||||
|
||||
parseInit :: Parser (Maybe Shell)
|
||||
parseInit = subparser $ command "init" (info go $ progDesc "Initializes embassy-publish config") <> metavar "init"
|
||||
parseInit = subparser $ command "init" (info go $ progDesc "Initializes registry-publish config") <> metavar "init"
|
||||
where
|
||||
shells = [Bash, Fish, Zsh]
|
||||
go = headMay . fmap fst . filter snd . zip shells <$> for shells (switch . long . toS . toLower . show)
|
||||
@@ -461,13 +461,13 @@ init sh = do
|
||||
for_ sh $ \case
|
||||
Bash -> do
|
||||
let bashrc = home </> ".bashrc"
|
||||
appendFile bashrc "source <(embassy-publish --bash-completion-script `which embassy-publish`)\n"
|
||||
appendFile bashrc "source <(registry-publish --bash-completion-script `which registry-publish`)\n"
|
||||
Fish -> do
|
||||
let fishrc = home </> ".config" </> "fish" </> "config.fish"
|
||||
appendFile fishrc "source <(embassy-publish --fish-completion-script `which embassy-publish`)\n"
|
||||
appendFile fishrc "source <(registry-publish --fish-completion-script `which registry-publish`)\n"
|
||||
Zsh -> do
|
||||
let zshcompleter = "/usr/local/share/zsh/site-functions/_embassy-publish"
|
||||
res <- readProcess "embassy-publish" ["--zsh-completion-script", "`which embassy-publish`"] ""
|
||||
let zshcompleter = "/usr/local/share/zsh/site-functions/_registry-publish"
|
||||
res <- readProcess "registry-publish" ["--zsh-completion-script", "`which registry-publish`"] ""
|
||||
writeFile zshcompleter (toS res)
|
||||
|
||||
|
||||
|
||||
20
src/Lib/External/AppMgr.hs
vendored
20
src/Lib/External/AppMgr.hs
vendored
@@ -105,23 +105,23 @@ sourceManifest ::
|
||||
(ConduitT () ByteString m () -> m r) ->
|
||||
m r
|
||||
sourceManifest appmgrPath pkgFile sink = do
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "embassy-sdk") ["inspect", "manifest", pkgFile] ""
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "start-sdk") ["inspect", "manifest", pkgFile] ""
|
||||
appmgr sink `catch` \ece ->
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|embassy-sdk inspect manifest #{pkgFile}|] (eceExitCode ece))
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|start-sdk inspect manifest #{pkgFile}|] (eceExitCode ece))
|
||||
|
||||
|
||||
sourceIcon :: (MonadUnliftIO m, MonadLoggerIO m) => FilePath -> FilePath -> (ConduitT () ByteString m () -> m r) -> m r
|
||||
sourceIcon appmgrPath pkgFile sink = do
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "embassy-sdk") ["inspect", "icon", pkgFile] ""
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "start-sdk") ["inspect", "icon", pkgFile] ""
|
||||
appmgr sink `catch` \ece ->
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|embassy-sdk inspect icon #{pkgFile}|] (eceExitCode ece))
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|start-sdk inspect icon #{pkgFile}|] (eceExitCode ece))
|
||||
|
||||
|
||||
getPackageHash :: (MonadUnliftIO m, MonadLoggerIO m) => FilePath -> FilePath -> m ByteString
|
||||
getPackageHash appmgrPath pkgFile = do
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "embassy-sdk") ["inspect", "hash", pkgFile] ""
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "start-sdk") ["inspect", "hash", pkgFile] ""
|
||||
appmgr (\bsSource -> runConduit $ bsSource .| CL.foldMap id) `catch` \ece ->
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|embassy-sdk inspect hash #{pkgFile}|] (eceExitCode ece))
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|start-sdk inspect hash #{pkgFile}|] (eceExitCode ece))
|
||||
|
||||
|
||||
sourceInstructions ::
|
||||
@@ -131,9 +131,9 @@ sourceInstructions ::
|
||||
(ConduitT () ByteString m () -> m r) ->
|
||||
m r
|
||||
sourceInstructions appmgrPath pkgFile sink = do
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "embassy-sdk") ["inspect", "instructions", pkgFile] ""
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "start-sdk") ["inspect", "instructions", pkgFile] ""
|
||||
appmgr sink `catch` \ece ->
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|embassy-sdk inspect instructions #{pkgFile}|] (eceExitCode ece))
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|start-sdk inspect instructions #{pkgFile}|] (eceExitCode ece))
|
||||
|
||||
|
||||
sourceLicense ::
|
||||
@@ -143,6 +143,6 @@ sourceLicense ::
|
||||
(ConduitT () ByteString m () -> m r) ->
|
||||
m r
|
||||
sourceLicense appmgrPath pkgFile sink = do
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "embassy-sdk") ["inspect", "license", pkgFile] ""
|
||||
let appmgr = readProcessInheritStderr (appmgrPath </> "start-sdk") ["inspect", "license", pkgFile] ""
|
||||
appmgr sink `catch` \ece ->
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|embassy-sdk inspect license #{pkgFile}|] (eceExitCode ece))
|
||||
$logErrorSH ece *> throwIO (AppMgrE [i|start-sdk inspect license #{pkgFile}|] (eceExitCode ece))
|
||||
|
||||
Reference in New Issue
Block a user