mirror of
https://github.com/sagiegurari/duckscript
synced 2024-11-05 16:09:58 +00:00
Maintenance: Migrate from unmaintained ftp crate to suppaftp fork
This commit is contained in:
parent
7387b5484c
commit
45a7859631
10 changed files with 85 additions and 148 deletions
|
@ -3,6 +3,7 @@
|
|||
### v0.8.14
|
||||
|
||||
* Maintenance: Runtime - Update dependencies
|
||||
* Maintenance: Migrate from unmaintained ftp crate to suppaftp fork
|
||||
|
||||
### v0.8.13 (2022-07-21)
|
||||
|
||||
|
|
206
Cargo.lock
generated
206
Cargo.lock
generated
|
@ -8,22 +8,13 @@ version = "1.0.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
|
||||
dependencies = [
|
||||
"memchr 0.1.11",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.7.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
|
||||
dependencies = [
|
||||
"memchr 2.5.0",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -52,7 +43,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
|||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -88,7 +79,7 @@ version = "0.2.17"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
|
||||
dependencies = [
|
||||
"memchr 2.5.0",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -117,12 +108,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.2.25"
|
||||
version = "0.4.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00"
|
||||
checksum = "6127248204b9aba09a362f6c930ef6a78f2c1b2215f8a7b398c06e1083f17af0"
|
||||
dependencies = [
|
||||
"num",
|
||||
"js-sys",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"time",
|
||||
"wasm-bindgen",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -132,8 +127,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"lazy_static 1.4.0",
|
||||
"winapi 0.3.9",
|
||||
"lazy_static",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -226,7 +221,6 @@ dependencies = [
|
|||
"duckscript",
|
||||
"fs_extra",
|
||||
"fsio",
|
||||
"ftp",
|
||||
"glob",
|
||||
"heck",
|
||||
"home",
|
||||
|
@ -238,6 +232,7 @@ dependencies = [
|
|||
"semver",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"suppaftp",
|
||||
"uname",
|
||||
"walkdir",
|
||||
"which",
|
||||
|
@ -386,17 +381,6 @@ dependencies = [
|
|||
"rand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ftp"
|
||||
version = "3.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "542951aad0071952c27409e3bd7cb62d1a3ad419c4e7314106bf994e0083ad5d"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"lazy_static 0.1.16",
|
||||
"regex 0.1.80",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.6"
|
||||
|
@ -430,11 +414,11 @@ version = "0.4.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a"
|
||||
dependencies = [
|
||||
"aho-corasick 0.7.18",
|
||||
"aho-corasick",
|
||||
"bstr",
|
||||
"fnv",
|
||||
"log",
|
||||
"regex 1.6.0",
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -458,7 +442,7 @@ version = "0.5.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
|
||||
dependencies = [
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -491,12 +475,12 @@ checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d"
|
|||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
"globset",
|
||||
"lazy_static 1.4.0",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"memchr 2.5.0",
|
||||
"regex 1.6.0",
|
||||
"memchr",
|
||||
"regex",
|
||||
"same-file",
|
||||
"thread_local 1.1.4",
|
||||
"thread_local",
|
||||
"walkdir",
|
||||
"winapi-util",
|
||||
]
|
||||
|
@ -523,8 +507,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "e1904d8654a1ef51034d02d5a9411b50bf91bea15b0ab644ae179d1325976263"
|
||||
dependencies = [
|
||||
"encoding",
|
||||
"lazy_static 1.4.0",
|
||||
"regex 1.6.0",
|
||||
"lazy_static",
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -537,20 +521,27 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "kernel32-sys"
|
||||
version = "0.2.2"
|
||||
name = "lazy-regex"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||
checksum = "b6b12f2eb6ed7d39405c5eb25a034b4c106a9ad87a6d9be3298de6c5f32fd57d"
|
||||
dependencies = [
|
||||
"winapi 0.2.8",
|
||||
"winapi-build",
|
||||
"lazy-regex-proc_macros",
|
||||
"once_cell",
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "0.1.16"
|
||||
name = "lazy-regex-proc_macros"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417"
|
||||
checksum = "f2496e5264069bc726ccf37eb76b9cd89406ae110d836c3f76729f99c8a23293"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
|
@ -579,15 +570,6 @@ version = "0.1.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.5.0"
|
||||
|
@ -619,7 +601,7 @@ version = "0.2.10"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9"
|
||||
dependencies = [
|
||||
"lazy_static 1.4.0",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"openssl",
|
||||
|
@ -637,17 +619,6 @@ version = "1.2.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce"
|
||||
|
||||
[[package]]
|
||||
name = "num"
|
||||
version = "0.1.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
|
||||
dependencies = [
|
||||
"num-integer",
|
||||
"num-iter",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.45"
|
||||
|
@ -658,17 +629,6 @@ dependencies = [
|
|||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-iter"
|
||||
version = "0.1.43"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.15"
|
||||
|
@ -814,36 +774,17 @@ dependencies = [
|
|||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "0.1.80"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
|
||||
dependencies = [
|
||||
"aho-corasick 0.5.3",
|
||||
"memchr 0.1.11",
|
||||
"regex-syntax 0.3.9",
|
||||
"thread_local 0.2.7",
|
||||
"utf8-ranges",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
|
||||
dependencies = [
|
||||
"aho-corasick 0.7.18",
|
||||
"memchr 2.5.0",
|
||||
"regex-syntax 0.6.27",
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
"regex-syntax",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.27"
|
||||
|
@ -856,7 +797,7 @@ version = "0.5.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
|
||||
dependencies = [
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -871,7 +812,7 @@ dependencies = [
|
|||
"spin",
|
||||
"untrusted",
|
||||
"web-sys",
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -907,7 +848,7 @@ version = "0.1.20"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
|
||||
dependencies = [
|
||||
"lazy_static 1.4.0",
|
||||
"lazy_static",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
|
@ -984,6 +925,18 @@ version = "0.5.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||
|
||||
[[package]]
|
||||
name = "suppaftp"
|
||||
version = "4.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "374fa36af4a114155280ba725b6487d78ec4ed8e54c69fe80f59805ffed9cd65"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"lazy-regex",
|
||||
"log",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.99"
|
||||
|
@ -1006,26 +959,27 @@ dependencies = [
|
|||
"libc",
|
||||
"redox_syscall",
|
||||
"remove_dir_all",
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread-id"
|
||||
version = "2.0.0"
|
||||
name = "thiserror"
|
||||
version = "1.0.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
|
||||
checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994"
|
||||
dependencies = [
|
||||
"kernel32-sys",
|
||||
"libc",
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "0.2.7"
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
|
||||
checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21"
|
||||
dependencies = [
|
||||
"thread-id",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1045,7 +999,7 @@ checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
|
|||
dependencies = [
|
||||
"libc",
|
||||
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1117,12 +1071,6 @@ dependencies = [
|
|||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "utf8-ranges"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
|
||||
|
||||
[[package]]
|
||||
name = "vcpkg"
|
||||
version = "0.2.15"
|
||||
|
@ -1142,7 +1090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
|
||||
dependencies = [
|
||||
"same-file",
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
|
@ -1248,7 +1196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae"
|
||||
dependencies = [
|
||||
"either",
|
||||
"lazy_static 1.4.0",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
]
|
||||
|
||||
|
@ -1268,12 +1216,6 @@ version = "2.1.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee583bdc5ff1cf9db20e9db5bb3ff4c3089a8f6b8b31aff265c9aba85812db86"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
@ -1284,12 +1226,6 @@ dependencies = [
|
|||
"winapi-x86_64-pc-windows-gnu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-build"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-i686-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
|
@ -1302,7 +1238,7 @@ version = "0.1.5"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
||||
dependencies = [
|
||||
"winapi 0.3.9",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -32,7 +32,6 @@ colored = "^2"
|
|||
duckscript = { version = "^0.7.3", path = "../duckscript" }
|
||||
fs_extra = "^1"
|
||||
fsio = { version = "^0.4", features = ["temp-path"] }
|
||||
ftp = "^3"
|
||||
glob = "^0.3"
|
||||
heck = "^0.4"
|
||||
home = "^0.5"
|
||||
|
@ -44,6 +43,7 @@ rand = "^0.8"
|
|||
semver = "^1"
|
||||
serde_json = "^1"
|
||||
sha2 = "^0.10"
|
||||
suppaftp = "^4.4"
|
||||
walkdir = "^2"
|
||||
which = { version = "^4", default-features = false }
|
||||
whoami = "^1"
|
||||
|
|
|
@ -2,9 +2,9 @@ use crate::sdk::std::net::ftp::{validate_and_run_with_connection, Options};
|
|||
use crate::utils::io::create_empty_file;
|
||||
use crate::utils::pckg;
|
||||
use duckscript::types::command::{Command, CommandResult};
|
||||
use ftp::{FtpError, FtpStream};
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::{BufWriter, Error, Read, Write};
|
||||
use suppaftp::{FtpError, FtpStream};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "./mod_test.rs"]
|
||||
|
@ -76,7 +76,7 @@ impl Command for CommandImpl {
|
|||
match ftp_stream.retr(&remote_file, |reader| {
|
||||
match write_file(reader, &local_file) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(error) => Err(FtpError::InvalidResponse(error.to_string())),
|
||||
Err(error) => Err(FtpError::ConnectionError(error)),
|
||||
}
|
||||
}) {
|
||||
Ok(_) => CommandResult::Continue(Some(true.to_string())),
|
||||
|
|
|
@ -4,8 +4,8 @@ use crate::utils::state::put_handle;
|
|||
use duckscript::types::command::{Command, CommandResult, Commands};
|
||||
use duckscript::types::instruction::Instruction;
|
||||
use duckscript::types::runtime::StateValue;
|
||||
use ftp::FtpStream;
|
||||
use std::collections::HashMap;
|
||||
use suppaftp::FtpStream;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "./mod_test.rs"]
|
||||
|
@ -60,7 +60,7 @@ impl Command for CommandImpl {
|
|||
let options_clone = options.clone();
|
||||
let remote_file = options_clone.remote_file.unwrap();
|
||||
|
||||
match ftp_stream.simple_retr(&remote_file) {
|
||||
match ftp_stream.retr_as_buffer(&remote_file) {
|
||||
Ok(binary) => {
|
||||
let key = put_handle(state, StateValue::ByteArray(binary.into_inner()));
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ use crate::utils::state::put_handle;
|
|||
use duckscript::types::command::{Command, CommandResult, Commands};
|
||||
use duckscript::types::instruction::Instruction;
|
||||
use duckscript::types::runtime::StateValue;
|
||||
use ftp::FtpStream;
|
||||
use std::collections::HashMap;
|
||||
use suppaftp::FtpStream;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "./mod_test.rs"]
|
||||
|
|
|
@ -8,8 +8,8 @@ mod put_in_memory;
|
|||
use crate::utils::pckg;
|
||||
use duckscript::types::command::{CommandResult, Commands};
|
||||
use duckscript::types::error::ScriptError;
|
||||
use ftp::types::{FileType, FormatControl};
|
||||
use ftp::FtpStream;
|
||||
use suppaftp::types::{FileType, FormatControl};
|
||||
use suppaftp::FtpStream;
|
||||
|
||||
static PACKAGE: &str = "ftp";
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ use crate::utils::state::put_handle;
|
|||
use duckscript::types::command::{Command, CommandResult, Commands};
|
||||
use duckscript::types::instruction::Instruction;
|
||||
use duckscript::types::runtime::StateValue;
|
||||
use ftp::FtpStream;
|
||||
use std::collections::HashMap;
|
||||
use suppaftp::FtpStream;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "./mod_test.rs"]
|
||||
|
|
|
@ -2,8 +2,8 @@ use crate::sdk::std::net::ftp::{validate_and_run_with_connection, Options};
|
|||
use crate::utils::pckg;
|
||||
use duckscript::types::command::{Command, CommandResult};
|
||||
use fsio::path::as_path::AsPath;
|
||||
use ftp::FtpStream;
|
||||
use std::fs::File;
|
||||
use suppaftp::FtpStream;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "./mod_test.rs"]
|
||||
|
@ -63,7 +63,7 @@ impl Command for CommandImpl {
|
|||
let local_file = options_clone.local_file.unwrap();
|
||||
|
||||
match File::open(local_file) {
|
||||
Ok(mut file) => match ftp_stream.put(&remote_file, &mut file) {
|
||||
Ok(mut file) => match ftp_stream.put_file(&remote_file, &mut file) {
|
||||
Ok(_) => CommandResult::Continue(Some(true.to_string())),
|
||||
Err(error) => CommandResult::Error(error.to_string()),
|
||||
},
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use crate::sdk::std::net::ftp::{validate_and_run_with_connection, Options};
|
||||
use crate::utils::pckg;
|
||||
use duckscript::types::command::{Command, CommandResult};
|
||||
use ftp::FtpStream;
|
||||
use std::io::Cursor;
|
||||
use suppaftp::FtpStream;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "./mod_test.rs"]
|
||||
|
@ -48,7 +48,7 @@ impl Command for CommandImpl {
|
|||
let content = options_clone.content.unwrap();
|
||||
|
||||
let mut reader = Cursor::new(content.as_bytes());
|
||||
match ftp_stream.put(&remote_file, &mut reader) {
|
||||
match ftp_stream.put_file(&remote_file, &mut reader) {
|
||||
Ok(_) => CommandResult::Continue(Some(true.to_string())),
|
||||
Err(error) => CommandResult::Error(error.to_string()),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue