小编con*_*xyz的帖子

如何让 cookiecutter 输出到当前工作目录而不是嵌套目录?

我们有许多用例,我们希望能够调用 cookiecutter 并将生成的文件和目录放入当前工作目录中。

简单的例子

本质上想要什么。

$ cd path/to/repo
$ ls
a.txt
$ cookiecutter path/to/template
$ls
a.txt b.txt
Run Code Online (Sandbox Code Playgroud)

结果实际上是什么

$ cd path/to/repo
$ ls
a.txt
$ cookiecutter path/to/template
$ls
a.txt 
template/
  b.txt
Run Code Online (Sandbox Code Playgroud)

我尝试过的事情

  1. 您可以想象模板是这样的。
template/
  cookiecutter.json
  b.txt
Run Code Online (Sandbox Code Playgroud)

但 cookiecutter 似乎要求默认有一个模板根以避免cookiecutter.exceptions.NonTemplatedInputDirException

  1. 因此,添加一个目录来包含模板文件,并尝试将其输出到特定目录。
template/
  cookiecutter.json
  {{cookiecutter.name}}
Run Code Online (Sandbox Code Playgroud)

但是,模板文件只是嵌套在当前工作目录的子目录中,当然如上面所示。

  1. 我还希望人们可以使用后生成挂钩将模板的输出文件移动到您想要的位置,但这似乎有点像黑客......

我不断看到 GitHub 上的评论基本上说“这已经解决了”,但我似乎找不到有关如何使用添加的任何功能来适应此用例的文档。

cookiecutter

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

使用setuptools时是否有任何理由列出标准库依赖项?

我已经走下了Python包装和分销兔洞,我想知道:

是否有过任何理由提供标准库模块/包的依赖关系,setup()使用时setuptools

并且附注:我发现的唯一setuptools文档非常糟糕.有更好的吗?

谢谢

python distutils setuptools

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

为什么安装版本 7 后 Angular CLI 版本显示为 1?

我正在尝试将我的 Angular CLI 全球版本更新到最新版本。

为什么ng v安装后还是不显示1.3.2版本?

我正在使用nvm顺便说一句。


安装前...

$ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / ? \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| …
Run Code Online (Sandbox Code Playgroud)

angular-cli angular

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

是否可以动态扭曲 SVG 文本?

是否可以动态扭曲 SVG 文本?

例如,您可以根据某些时间数据应用具有移动参数的过滤器吗?

谢谢。

html css svg

0
推荐指数
1
解决办法
485
查看次数

标签 统计

angular ×1

angular-cli ×1

cookiecutter ×1

css ×1

distutils ×1

html ×1

python ×1

setuptools ×1

svg ×1