sh 从命令行打开Neos项目

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 从命令行打开Neos项目相关的知识,希望对你有一定的参考价值。

# With the command `NeosProject` you get the site package folder and available folders definded in `ADDITIONAL_FOLDER`
# With `codeProject` you open your project in Visual Studio Code
# With `atomProject` you open your project in Atom
# With `pstormProject` you open your project in PHP Storm
# To disable the fallback (open current folder), change the fallback variable to ""

NeosProject() {
  # Places where site packages could are stored
  local SITE_FOLDER=(".src" "_src" "Packages/Sites")

  # Additional folder to open
  local ADDITIONAL_FOLDER=("Packages/Plugins" "Web")

  local FOLDER_ARRAY=()

  local fallback="."

  # Get the site folder
  for f in "${SITE_FOLDER[@]}"
    do
      if [ -d $f -a ${#FOLDER_ARRAY[@]} == 0 ]
        then FOLDER_ARRAY+=("${f}/$([ $(echo ${f}/* | wc -w) == 1 ] && basename ${f}/*)");
      fi
  done

  # Get additional folder
  for f in "${ADDITIONAL_FOLDER[@]}"
    do
      if [ -d "${f}" ]
        then FOLDER_ARRAY+=($f)
      fi
  done

  # Fallback
  if [ -n "$fallback" -a  ${#FOLDER_ARRAY[@]} == 0 ]
    then FOLDER_ARRAY=($fallback)
  fi;
  echo "${FOLDER_ARRAY[@]}"
}

codeProject() {
  # If we have a code workspace, open this instead
  if [ -f *.code-workspace ];
    then for f in *.code-workspace; do open "$f"; done;
    else code $(NeosProject);
  fi;
}

atomProject() {
  atom $(NeosProject)
}

sublimeProject() {
  sublime $(NeosProject)
}

pstormProject() {
  pstorm $(NeosProject)
}

以上是关于sh 从命令行打开Neos项目的主要内容,如果未能解决你的问题,请参考以下文章

sh Neos包装neu laden

带有 Neos CMS 的 AWS Lambda 的 bref.sh php 容器

sh 从命令行打开本地站点

sh 从命令行打开Sublime Text

如何在Neos CMS中创建新项目?

sh 使用Windows上的Git Bash通过命令行打开WebStorm文件。