Skip to content

Commit b1171f5

Browse files
committed
work with pre-existing folders
1 parent 81c563e commit b1171f5

File tree

4 files changed

+127
-11
lines changed

4 files changed

+127
-11
lines changed

.ackrc

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
--ignore-ack-defaults
2+
--ignore-directory=is:.bzr
3+
--ignore-directory=is:.cdv
4+
--ignore-directory=is:~.dep
5+
--ignore-directory=is:~.dot
6+
--ignore-directory=is:~.nib
7+
--ignore-directory=is:~.plst
8+
--ignore-directory=is:.git
9+
--ignore-directory=is:.hg
10+
--ignore-directory=is:.pc
11+
--ignore-directory=is:.svn
12+
--ignore-directory=is:_MTN
13+
--ignore-directory=is:CVS
14+
--ignore-directory=is:RCS
15+
--ignore-directory=is:SCCS
16+
--ignore-directory=is:_darcs
17+
--ignore-directory=is:_sgbak
18+
--ignore-directory=is:autom4te.cache
19+
--ignore-directory=is:blib
20+
--ignore-directory=is:_build
21+
--ignore-directory=is:cover_db
22+
--ignore-directory=is:node_modules
23+
--ignore-directory=is:CMakeFiles
24+
--ignore-directory=is:static-transpile
25+
--ignore-directory=is:media
26+
--ignore-directory=is:static-collected
27+
--ignore-directory=is:static-libs
28+
--ignore-directory=is:.transpile-cache
29+
--ignore-directory=is:.transpile
30+
--ignore-directory=is:fiduswriter.egg-info
31+
--ignore-directory=is:fixtures
32+
--ignore-directory=is:venv
33+
--ignore-directory=is:.direnv
34+
--ignore-directory=is:build
35+
--ignore-file=ext:bak
36+
--ignore-file=match:/~$/
37+
--ignore-file=match:/^#.+#$/
38+
--ignore-file=match:/[._].*\.swp$/
39+
--ignore-file=match:/core\.\d+$/
40+
--ignore-file=match:/[.-]min[.]js$/
41+
--ignore-file=match:/[.]js[.]min$/
42+
--ignore-file=match:/[.]min[.]css$/
43+
--ignore-file=match:/[.]css[.]min$/
44+
--ignore-file=match:-package.json
45+
--ignore-file=ext:pdf
46+
--ignore-file=ext:gif,jpg,jpeg,png
47+
--type-add=perl:ext:pl,pm,pod,t,psgi
48+
--type-add=perl:firstlinematch:/^#!.*\bperl/
49+
--type-add=perltest:ext:t
50+
--type-add=make:ext:mk
51+
--type-add=make:ext:mak
52+
--type-add=make:is:makefile
53+
--type-add=make:is:Makefile
54+
--type-add=make:is:GNUmakefile
55+
--type-add=rake:is:Rakefile
56+
--type-add=cmake:is:CMakeLists.txt
57+
--type-add=cmake:ext:cmake
58+
--type-add=actionscript:ext:as,mxml
59+
--type-add=ada:ext:ada,adb,ads
60+
--type-add=asp:ext:asp
61+
--type-add=aspx:ext:master,ascx,asmx,aspx,svc
62+
--type-add=asm:ext:asm,s
63+
--type-add=batch:ext:bat,cmd
64+
--type-add=cfmx:ext:cfc,cfm,cfml
65+
--type-add=clojure:ext:clj
66+
--type-add=cc:ext:c,h,xs
67+
--type-add=hh:ext:h
68+
--type-add=coffeescript:ext:coffee
69+
--type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx
70+
--type-add=csharp:ext:cs
71+
--type-add=css:ext:css
72+
--type-add=dart:ext:dart
73+
--type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj
74+
--type-add=elixir:ext:ex,exs
75+
--type-add=elisp:ext:el
76+
--type-add=erlang:ext:erl,hrl
77+
--type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp
78+
--type-add=go:ext:go
79+
--type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle
80+
--type-add=haskell:ext:hs,lhs
81+
--type-add=html:ext:htm,html
82+
--type-add=java:ext:java,properties
83+
--type-add=js:ext:js
84+
--type-add=jsp:ext:jsp,jspx,jhtm,jhtml
85+
--type-add=json:ext:json
86+
--type-add=less:ext:less
87+
--type-add=lisp:ext:lisp,lsp
88+
--type-add=lua:ext:lua
89+
--type-add=lua:firstlinematch:/^#!.*\blua(jit)?/
90+
--type-add=objc:ext:m,h
91+
--type-add=objcpp:ext:mm,h
92+
--type-add=ocaml:ext:ml,mli
93+
--type-add=matlab:ext:m
94+
--type-add=parrot:ext:pir,pasm,pmc,ops,pod,pg,tg
95+
--type-add=php:ext:php,phpt,php3,php4,php5,phtml
96+
--type-add=php:firstlinematch:/^#!.*\bphp/
97+
--type-add=plone:ext:pt,cpt,metadata,cpy,py
98+
--type-add=python:ext:py
99+
--type-add=python:firstlinematch:/^#!.*\bpython/
100+
--type-add=rr:ext:R
101+
--type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec
102+
--type-add=ruby:is:Rakefile
103+
--type-add=ruby:firstlinematch:/^#!.*\bruby/
104+
--type-add=rust:ext:rs
105+
--type-add=sass:ext:sass,scss
106+
--type-add=scala:ext:scala
107+
--type-add=scheme:ext:scm,ss
108+
--type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
109+
--type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
110+
--type-add=smalltalk:ext:st
111+
--type-add=sql:ext:sql,ctl
112+
--type-add=tcl:ext:tcl,itcl,itk
113+
--type-add=tex:ext:tex,cls,sty
114+
--type-add=tt:ext:tt,tt2,ttml
115+
--type-add=vb:ext:bas,cls,frm,ctl,vb,resx
116+
--type-add=verilog:ext:v,vh,sv
117+
--type-add=vhdl:ext:vhd,vhdl
118+
--type-add=vim:ext:vim
119+
--type-add=xml:ext:xml,dtd,xsl,xslt,ent
120+
--type-add=xml:firstlinematch:/<[?]xml/
121+
--type-add=yaml:ext:yaml,yml

npm_mjs/management/commands/create_package_json.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def handle(self, *args, **options):
4545
else:
4646
continue
4747
deep_merge_dicts(package, data)
48-
if not os.path.exists(TRANSPILE_CACHE_PATH):
49-
os.makedirs(TRANSPILE_CACHE_PATH)
48+
os.makedirs(TRANSPILE_CACHE_PATH, exists_ok=True)
5049
package_path = os.path.join(TRANSPILE_CACHE_PATH, "package.json")
5150
with open(package_path, "w") as outfile:
5251
json.dump(package, outfile)

npm_mjs/management/commands/npm_install.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def install_npm(force, stdout, post_npm_signal=True):
4848
or force
4949
):
5050
stdout.write("Installing pnpm dependencies...")
51-
if not os.path.exists(TRANSPILE_CACHE_PATH):
52-
os.makedirs(TRANSPILE_CACHE_PATH)
51+
os.makedirs(TRANSPILE_CACHE_PATH, exists_ok=True)
5352
set_last_run("npm_install", int(round(time.time())))
5453
call_command("create_package_json")
5554

npm_mjs/management/commands/transpile.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ def handle(self, *args, **options):
8181
# Remove any previously created static output dirs
8282
shutil.rmtree(transpile_path, ignore_errors=True)
8383
self.stdout.write("Transpiling...")
84-
if not os.path.exists(TRANSPILE_CACHE_PATH):
85-
os.makedirs(TRANSPILE_CACHE_PATH)
84+
os.makedirs(TRANSPILE_CACHE_PATH, exists_ok=True)
8685
# We reload the file as other values may have changed in the meantime
8786
set_last_run("transpile", start)
8887
# Create a static output dir
8988
out_dir = os.path.join(transpile_path, "js/")
90-
os.makedirs(out_dir)
89+
os.makedirs(out_dir, exists_ok=True)
9190
with open(os.path.join(transpile_path, "README.txt"), "w") as f:
9291
f.write(
9392
"These files have been automatically generated. "
@@ -125,8 +124,7 @@ def handle(self, *args, **options):
125124
# Apps.
126125

127126
cache_path = os.path.join(TRANSPILE_CACHE_PATH, "js/")
128-
if not os.path.exists(cache_path):
129-
os.makedirs(cache_path)
127+
os.makedirs(cache_path, exists_ok=True)
130128
# Note all cache files so that we can remove outdated files that no
131129
# longer are in the prject.
132130
cache_files = []
@@ -138,8 +136,7 @@ def handle(self, *args, **options):
138136
outfile = os.path.join(cache_path, relative_path)
139137
cache_files.append(outfile)
140138
dirname = os.path.dirname(outfile)
141-
if not os.path.exists(dirname):
142-
os.makedirs(dirname)
139+
os.makedirs(dirname, exists_ok=True)
143140
shutil.copyfile(sourcefile, outfile)
144141
# Check for plugin connectors
145142
if relative_path[:8] == "plugins/":

0 commit comments

Comments
 (0)