yurii/sage

CLI 辅助工具,用于本地开发

0.15.0 2023-01-08 04:10 UTC

README

Sage 是 macOS(High Sierra、Mojave、Catalina 和 Big Sur on intel)开发环境的辅助工具。

安装

  1. 由于 Sage 依赖于 Brew,请使用 brew update 将 Homebrew 安装或更新到最新版本。
# if not installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# add the next line into your ~/.bash_profile file (create if not exists)

export PATH="$PATH:/usr/local/sbin:$HOME/bin:$HOME/.composer/vendor/bin"


# if installed

brew update
brew upgrade
  1. 由于 macOS 默认没有 PHP,应通过 brew 手动安装。
brew install shivammathur/php/php@7.3
  1. 最新版本 下载 phar 包,并将其放在 $HOME/bin 文件夹中。
curl -L https://github.com/ytorbyk/sage/releases/latest/download/sage.phar > $HOME/bin/bin-sage
chmod +x $HOME/bin/bin-sage
  1. 创建一个名为 $HOME/bin/sage 的 txt 文件,内容如下
#!/usr/bin/env bash
/usr/local/opt/php@7.3/bin/php "$HOME/bin/bin-sage" "$@"
  1. 使 txt 文件可执行
chown +x $HOME/bin/sage
  1. (可选步骤)自定义配置
# It creates configuration dump ~/xSage/config.php.
# You can customize and move it to ~/.sage/config.php before next step if you want.

sage env:config-dump
  1. 安装和配置所需环境
# It's automatic, you will prompt to enter your password once and two times MySQL root password.
# If you don't have installed MySQL before, just press enter (there is no password by default).
# After installation MySQL root password is 1 (until you changed it in ~/.sage/config.php config in node mysql.password)

sage env:install
  1. (可选步骤)为应用程序安装 Bash 完成脚本
sage env:completion
  1. 准备就绪
# Displays a list of supported commands with short descriptions

sage list