小编Ase*_*nar的帖子

Git预提交挂钩没有在Windows上运行

我刚刚开始研究Git钩子,但我似乎无法让它们运行.

我设置了一个本地存储库,所以我的项目文件夹中现在有一个'.git'目录.我已将".cmd"文件添加到名为"pre-commit.cmd"的C:/path/to/my/project/.git/hooks目录中.这是这个文件的内容:

echo "HOOK RUNNING"
echo. 2>C:/path/to/my/project/.git/hooks/EmptyFile.txt
Run Code Online (Sandbox Code Playgroud)

这应该回显文本"HOOK RUNNING"并在该目录中创建一个空文本文件.但是,如果我通过我的IDE(NetBeans)提交更改或使用Git Bash提交,它们似乎都没有运行我的预提交挂钩,因为没有创建文件.

我的理解是,你需要做的就是使用钩子的名称来添加一个可执行文件(正如我所做的那样).难道我做错了什么?

注意:这是在Windows 7 PC上.

windows git version-control githooks

40
推荐指数
4
解决办法
3万
查看次数

类型“React.ReactNode”不可分配给类型“import(".../@types/react-transition-group/node_modules/@types/react/index").ReactNode”

我曾经使用过 React 项目,与 Circle CI 集成,经过一些小的更改,它开始使所有构建失败

Its instance type 'ReactApexChart' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/home/circleci/app.mxney-board-v2.test/node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode'.

79       <Chart options={fillOptions} series={graphData} height={chartHeight} />
          ~~~~~

src/index.tsx:20:8 - error TS2786: 'App' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<Omit<Subtract<unknown, WithTranslationProps>, keyof WithTranslation<N>> & WithTranslationProps, any, any> | null' is not a valid JSX element.
    Type 'Component<Omit<Subtract<unknown, WithTranslationProps>, keyof WithTranslation<N>> …
Run Code Online (Sandbox Code Playgroud)

typescript circleci reactjs yarnpkg

11
推荐指数
1
解决办法
6465
查看次数

静默执行vim命令然后在vim中回显

我想autocmd BufWrite在我的 中执行 shell 命令.vimrc,然后 echo (在 vim 中)\xc2\xa0a 消息说它已经完成,而不显示 shell。

\n\n

(基本上touch *.less),然后回显一条信息消息“文件已触及!”。

\n\n

第一部分有效,但第二个命令是在 shell 而不是 vim 中执行的。

\n\n

命令应该是这样的:

\n\n
autocmd BufWritePost *.less silent! !touch \'%:p:h\'/*.less | echo \'file  \'.expand(\'%:p:h\').\' touched !\'\n
Run Code Online (Sandbox Code Playgroud)\n\n

我想我需要一种方法来“结束”命令并允许其他命令。

\n\n

我尝试了这个但没有取得更大的成功:

\n\n
:silent !touch \'%:p:h\'/*.less && exit 0 | unsilent! | echo "file touched"\n
Run Code Online (Sandbox Code Playgroud)\n\n

任何想法 ?

\n

vim bash shell

2
推荐指数
1
解决办法
4196
查看次数

标签 统计

bash ×1

circleci ×1

git ×1

githooks ×1

reactjs ×1

shell ×1

typescript ×1

version-control ×1

vim ×1

windows ×1

yarnpkg ×1