From 665b9dd04b9742ec7bcd55c663ac80b46a374dc4 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:40:30 -0400 Subject: [PATCH] rename from embassy-sdk to start-sdk and embassy-publish to registr-publish --- .gitignore | 1 + Makefile | 2 +- README.md | 10 +++++----- hie.yaml | 2 +- package.yaml | 2 +- src/Cli/Cli.hs | 10 +++++----- src/Lib/External/AppMgr.hs | 20 ++++++++++---------- 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 65bca3c..50714cd 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ version **/*.s9pk **/appmgr 0.3.0_features.md +**/start-sdk **/embassy-sdk start9-registry.prof start9-registry.hp diff --git a/Makefile b/Makefile index 421c4fb..8b2d48f 100644 --- a/Makefile +++ b/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/ diff --git a/README.md b/README.md index 71b90c0..6036b04 100644 --- a/README.md +++ b/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 -n -u -p ` (include https:// in your URL) +- run `registry-publish init --bash` (or --zsh / --fish depending on your preferred shell) +- run `registry-publish reg add -l -n -u -p ` (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 diff --git a/hie.yaml b/hie.yaml index 0704f37..48ed33d 100644 --- a/hie.yaml +++ b/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" diff --git a/package.yaml b/package.yaml index 2fad37b..52f6cfb 100644 --- a/package.yaml +++ b/package.yaml @@ -111,7 +111,7 @@ executables: when: - condition: flag(library-only) buildable: false - embassy-publish: + registry-publish: source-dirs: cli main: Main.hs ghc-options: diff --git a/src/Cli/Cli.hs b/src/Cli/Cli.hs index 341206c..153eb37 100644 --- a/src/Cli/Cli.hs +++ b/src/Cli/Cli.hs @@ -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) diff --git a/src/Lib/External/AppMgr.hs b/src/Lib/External/AppMgr.hs index 4caa398..ab9c83a 100644 --- a/src/Lib/External/AppMgr.hs +++ b/src/Lib/External/AppMgr.hs @@ -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))