小编den*_*hik的帖子

无法使grunt-contrib-compass工作

所以我有以下情况.当我从CLI使用指南针时它只是工作并完全符合要求.我正在compass compile从文件所在的同一文件夹config.rb(在styles文件夹中)运行.它还包含sasscss目录.这是我的config.rb档案:

project_path = '.'
css_dir = "css"
sass_dir = "sass"
images_dir = "../../data/images"
javascripts_dir = "../scripts"

output_style = :compressed
environment = :development
relative_assets = true
Run Code Online (Sandbox Code Playgroud)

当我尝试使用grunt此时,我使用以下配置Gruntfile.js:

compass: {
    compile: {
        options: {
            basePath: 'app/src/styles',
            config: 'app/src/styles/config.rb'
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

app文件夹Gruntfile.js位于同一级别.当我跑步时,grunt compass我看到以下输出:

Running "compass:dist" (compass) task
Nothing to compile. If you're trying to start a new project, you …
Run Code Online (Sandbox Code Playgroud)

gruntjs compass-sass

10
推荐指数
1
解决办法
7790
查看次数

如何检查git分支是否具有跟踪分支?

我正在为bash写一个小的git helper,我需要知道某个名称的分支是否具有跟踪分支。

更具体地说,问题是,如果git pull在没有跟踪分支的分支上运行,它将失败,并显示以下内容:

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> foo
Run Code Online (Sandbox Code Playgroud)

git pull --quiet 也不会隐藏此消息。

我设法找到了这个有用的快捷方式:

git rev-parse --symbolic --abbrev-ref foo@{u}
Run Code Online (Sandbox Code Playgroud)

如果存在跟踪分支,它将完全满足我的需要,并输出以下内容:

origin/foo
Run Code Online (Sandbox Code Playgroud)

但是,如果分支没有跟踪分支,则输出如下:

fatal: No upstream configured for branch 'foo'
Run Code Online (Sandbox Code Playgroud)

除了它以非零状态存在并将其输出到stderr外,这还可以。

所以我基本上想做的是:

tracking_branch=$(git do-some-magick foo)
if [[ -n $tracking_branch …
Run Code Online (Sandbox Code Playgroud)

git bash

3
推荐指数
1
解决办法
676
查看次数

标签 统计

bash ×1

compass-sass ×1

git ×1

gruntjs ×1