File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,15 @@ fn main() -> Result<()> {
87
87
println ! ( "cargo::rustc-check-cfg=cfg(icons_out_dir)" ) ;
88
88
println ! ( "cargo:rustc-cfg=icons_out_dir" ) ;
89
89
90
- let package_dir = env:: var ( "CARGO_MANIFEST_DIR" ) . context ( "missing CARGO_MANIFEST_DIR" ) ?;
91
- let package_dir = Path :: new ( & package_dir) ;
92
- generate_css_icons ( package_dir. join ( "static/icons.css" ) , out_dir) ?;
90
+ let out_css = "static/icons.css" ;
91
+ let out_css = if std:: env:: var ( "RUN_IN_DOCKER" ) . is_ok ( ) {
92
+ let _ = std:: fs:: create_dir_all ( "/srv/docsrs/static" ) ;
93
+ Path :: new ( "/srv/docsrs/" ) . join ( out_css)
94
+ } else {
95
+ let package_dir = env:: var ( "CARGO_MANIFEST_DIR" ) . context ( "missing CARGO_MANIFEST_DIR" ) ?;
96
+ Path :: new ( & package_dir) . join ( out_css)
97
+ } ;
98
+ generate_css_icons ( out_css, out_dir) ?;
93
99
94
100
// trigger recompilation when a new migration is added
95
101
println ! ( "cargo:rerun-if-changed=migrations" ) ;
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ COPY assets assets/
61
61
COPY .sqlx .sqlx/
62
62
COPY migrations migrations/
63
63
64
+ ENV RUN_IN_DOCKER="1"
64
65
RUN cargo build --profile=$PROFILE
65
66
66
67
# #####################
You can’t perform that action at this time.
0 commit comments