change name of functions
This commit is contained in:
@@ -10,6 +10,7 @@ use crate::utils::path::path_buf_to_string;
|
||||
use crate::utils::remote::{enumerate_remote, EnumerateOptions};
|
||||
use crate::global::global::{DIR_PATH, set_dir_path};
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::{ReqProps, ObjProps};
|
||||
use crate::store::object::{tree, blob::Blob};
|
||||
use crate::commands::config;
|
||||
|
||||
@@ -2,6 +2,7 @@ use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::r#copy::Copy;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::commands::status::LocalObj;
|
||||
use crate::commands::push::push_factory::{PushState, PushChange, PushFlowState};
|
||||
@@ -26,10 +27,10 @@ impl PushChange for Copied {
|
||||
fn push(&self) -> io::Result<()> {
|
||||
let obj = &self.obj;
|
||||
let res = Copy::new()
|
||||
.set_url(
|
||||
.set_url_copy(
|
||||
&path_buf_to_string(obj.path_from.clone().unwrap()),
|
||||
obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::delete_path::DeletePath;
|
||||
use crate::store::index;
|
||||
use crate::store::object::blob::Blob;
|
||||
@@ -26,7 +27,7 @@ impl PushChange for Deleted {
|
||||
let obj = &self.obj;
|
||||
let res = DeletePath::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::services::upload_file::UploadFile;
|
||||
use crate::commands::status::LocalObj;
|
||||
@@ -27,7 +28,7 @@ impl PushChange for Modified {
|
||||
let res = UploadFile::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.set_file(obj.path.clone())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::r#move::Move;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::commands::status::LocalObj;
|
||||
@@ -26,10 +27,10 @@ impl PushChange for Moved {
|
||||
fn push(&self) -> io::Result<()> {
|
||||
let obj = &self.obj;
|
||||
let res = Move::new()
|
||||
.set_url(
|
||||
.set_url_move(
|
||||
&path_buf_to_string(obj.path_from.clone().unwrap()),
|
||||
obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::services::upload_file::UploadFile;
|
||||
use crate::store::object::blob::Blob;
|
||||
@@ -27,7 +28,7 @@ impl PushChange for New {
|
||||
let res = UploadFile::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.set_file(obj.path.clone())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::services::create_folder::CreateFolder;
|
||||
use crate::store::index;
|
||||
@@ -33,7 +34,7 @@ impl PushChange for NewDir {
|
||||
let obj = &self.obj;
|
||||
let res = CreateFolder::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -2,6 +2,7 @@ use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::commands::status::{State, LocalObj};
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::commands::push::new::New;
|
||||
use crate::commands::push::new_dir::NewDir;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::delete_path::DeletePath;
|
||||
use crate::store::index;
|
||||
use crate::store::object::tree;
|
||||
@@ -32,7 +33,7 @@ impl PushChange for RmDir {
|
||||
let obj = &self.obj;
|
||||
let res = DeletePath::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::{ReqProps, ObjProps};
|
||||
use crate::store::object::Object;
|
||||
use crate::utils::api::{ApiProps, get_api_props};
|
||||
|
||||
@@ -7,4 +7,8 @@ pub mod delete_path;
|
||||
pub mod downloader;
|
||||
pub mod r#move;
|
||||
pub mod r#copy;
|
||||
pub mod login;
|
||||
pub mod request_manager;
|
||||
pub mod api_call;
|
||||
//pub mod auth;
|
||||
//pub mod bulk_upload;
|
||||
|
||||
@@ -2,7 +2,6 @@ use std::fs::File;
|
||||
use std::io::{BufReader, BufRead};
|
||||
use regex::Regex;
|
||||
use crate::utils::path;
|
||||
use std::io::Cursor;
|
||||
|
||||
pub fn read_lines() -> Result<Vec<String>, ()> {
|
||||
if let Some(path) = path::nextsyncignore() {
|
||||
|
||||
Reference in New Issue
Block a user