GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add additional check to feather-data build script to prevent rebuildi… · BuggStream/feather@5a856c3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • data
    • build.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎data/build.rs‎

Copy file name to clipboardExpand all lines: data/build.rs
+12-6Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use reqwest;
21
use std::env;
32
use std::error::Error;
43
use std::fs;
@@ -9,10 +8,14 @@ use std::process::Command;
98

109
fn main() -> Result<(), Box<dyn Error>> {
1110
let path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/minecraft"));
12-
dbg!(path);
1311
let path_server = path.join("server.jar");
12+
1413
println!("cargo:rerun-if-changed={}", &path.display());
1514

15+
if data_exists(path).unwrap_or(false) {
16+
return Ok(());
17+
}
18+
1619
let _ = fs::remove_dir_all(&path);
1720
fs::create_dir_all(&path)?;
1821

@@ -22,11 +25,14 @@ fn main() -> Result<(), Box<dyn Error>> {
2225
Ok(())
2326
}
2427

25-
fn donwload<P: AsRef<Path>>(server: P) -> Result<(), Box<dyn Error>> {
26-
if File::open(&server).is_ok() {
27-
return Ok(());
28-
}
28+
fn data_exists(path: &Path) -> Result<bool, Box<dyn Error>> {
29+
Ok(File::open(path.join("server.jar")).is_ok()
30+
&& File::open(path.join("assets")).is_ok()
31+
&& File::open(path.join("data")).is_ok()
32+
&& File::open(path.join("generated")).is_ok())
33+
}
2934

35+
fn donwload<P: AsRef<Path>>(server: P) -> Result<(), Box<dyn Error>> {
3036
let mut response = reqwest::blocking::get("https://launcher.mojang.com/v1/objects/3737db93722a9e39eeada7c27e7aca28b144ffa7/server.jar")?;
3137
let mut dest = File::create(server)?;
3238
copy(&mut response, &mut dest)?;

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.