diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c8f67ac..664c85c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,3 +17,4 @@ jobs: run: | find ./samples/cloudfuse_plugin/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i --dry-run --Werror find ./samples/unit_tests/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i --dry-run --Werror + find ./src/cloudfuse/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i --dry-run --Werror diff --git a/src/cloudfuse/child_process.cpp b/src/cloudfuse/child_process.cpp index a4af5a2..2bd43a7 100644 --- a/src/cloudfuse/child_process.cpp +++ b/src/cloudfuse/child_process.cpp @@ -1,9 +1,11 @@ #include "child_process.h" -std::string CloudfuseMngr::getMountDir() { +std::string CloudfuseMngr::getMountDir() +{ return mountDir; } -std::string CloudfuseMngr::getFileCacheDir() { +std::string CloudfuseMngr::getFileCacheDir() +{ return fileCacheDir; } diff --git a/src/cloudfuse/child_process.h b/src/cloudfuse/child_process.h index 0ceffbe..5f15193 100644 --- a/src/cloudfuse/child_process.h +++ b/src/cloudfuse/child_process.h @@ -1,38 +1,42 @@ #include -struct processReturn { - int errCode; // 0 if successful, failed otherwise +struct processReturn +{ + int errCode; // 0 if successful, failed otherwise std::string output; // std err and std out from cloudfuse command }; -class CloudfuseMngr { -public: +class CloudfuseMngr +{ + public: CloudfuseMngr(); - #ifdef _WIN32 +#ifdef _WIN32 CloudfuseMngr(std::string mountDir, std::string configFile, std::string fileCachePath); processReturn dryRun(std::string passphrase); processReturn mount(std::string passphrase); - processReturn genS3Config(std::string accessKeyId, std::string secretAccessKey, std::string region, std::string endpoint, std::string bucketName, std::string passphrase); - #elif defined(__linux__) || defined(__APPLE__) + processReturn genS3Config(std::string accessKeyId, std::string secretAccessKey, std::string region, + std::string endpoint, std::string bucketName, std::string passphrase); +#elif defined(__linux__) || defined(__APPLE__) CloudfuseMngr(std::string mountDir, std::string fileCacheDir, std::string configFile, std::string templateFile); processReturn dryRun(std::string accessKeyId, std::string secretAccessKey, std::string passphrase); processReturn mount(std::string accessKeyId, std::string secretAccessKey, std::string passphrase); processReturn genS3Config(std::string region, std::string endpoint, std::string bucketName, std::string passphrase); - #endif +#endif std::string getMountDir(); std::string getFileCacheDir(); processReturn unmount(); bool isInstalled(); bool isMounted(); -private: + + private: std::string mountDir; std::string configFile; std::string fileCacheDir; std::string templateFile; - #ifdef _WIN32 - processReturn spawnProcess(wchar_t* argv, std::wstring envp); +#ifdef _WIN32 + processReturn spawnProcess(wchar_t *argv, std::wstring envp); processReturn encryptConfig(std::string passphrase); - #elif defined(__linux__) || defined(__APPLE__) +#elif defined(__linux__) || defined(__APPLE__) processReturn spawnProcess(char *const argv[], char *const envp[]); - #endif +#endif }; diff --git a/src/cloudfuse/child_process_linux.cpp b/src/cloudfuse/child_process_linux.cpp index ee80db0..54210d8 100644 --- a/src/cloudfuse/child_process_linux.cpp +++ b/src/cloudfuse/child_process_linux.cpp @@ -1,9 +1,9 @@ #if defined(__linux__) #include "child_process.h" #include -#include -#include #include +#include +#include std::string config_template = R"( allow-other: true @@ -39,12 +39,16 @@ allow-other: true region: { AWS_REGION } )"; -CloudfuseMngr::CloudfuseMngr() { +CloudfuseMngr::CloudfuseMngr() +{ std::string homeEnv; const char *home = std::getenv("HOME"); - if (home == nullptr) { + if (home == nullptr) + { homeEnv = ""; - } else { + } + else + { homeEnv = home; } mountDir = homeEnv + "/cloudfuse"; @@ -53,68 +57,84 @@ CloudfuseMngr::CloudfuseMngr() { templateFile = homeEnv + "/nx_plugin_config.yaml"; std::ifstream in(templateFile); - if (!in.good()) { + if (!in.good()) + { std::ofstream out(templateFile); out << config_template; out.close(); } } -CloudfuseMngr::CloudfuseMngr(std::string mountDir, std::string fileCacheDir, std::string configFile, std::string templateFile) { +CloudfuseMngr::CloudfuseMngr(std::string mountDir, std::string fileCacheDir, std::string configFile, + std::string templateFile) +{ this->mountDir = mountDir; this->configFile = configFile; this->fileCacheDir = fileCacheDir; this->templateFile = templateFile; } -processReturn CloudfuseMngr::spawnProcess(char *const argv[], char *const envp[]) { +processReturn CloudfuseMngr::spawnProcess(char *const argv[], char *const envp[]) +{ processReturn ret; int pipefd[2]; - if (pipe(pipefd) == -1) { + if (pipe(pipefd) == -1) + { throw std::runtime_error("Failed to create pipe."); } - + pid_t pid = fork(); - if (pid == -1) { + if (pid == -1) + { // Fork failed throw std::runtime_error("Failed to fork process."); - } else if (pid != 0) { + } + else if (pid != 0) + { // Parent process close(pipefd[1]); // Close write end of pipe char buffer[4096]; int bytesRead; - while ((bytesRead = read(pipefd[0], buffer, sizeof(buffer))) > 0) { + while ((bytesRead = read(pipefd[0], buffer, sizeof(buffer))) > 0) + { ret.output.append(buffer, bytesRead); } close(pipefd[0]); // Close read end of pipe - + // Wait for cloudfuse command to stop int status; waitpid(pid, &status, 0); - if (WIFEXITED(status)) { + if (WIFEXITED(status)) + { ret.errCode = WEXITSTATUS(status); return ret; - } else if (WIFSIGNALED(status)) { + } + else if (WIFSIGNALED(status)) + { ret.errCode = WTERMSIG(status); return ret; } ret.errCode = WTERMSIG(status); return ret; - } else { + } + else + { // Child process close(pipefd[0]); // Close read end of pipe - if (dup2(pipefd[1], STDOUT_FILENO) == -1 || dup2(pipefd[1], STDERR_FILENO) == -1) { + if (dup2(pipefd[1], STDOUT_FILENO) == -1 || dup2(pipefd[1], STDERR_FILENO) == -1) + { exit(EXIT_FAILURE); } - + close(pipefd[1]); // Close write end of pipe - if (execve(argv[0], argv, envp) == -1) { + if (execve(argv[0], argv, envp) == -1) + { exit(EXIT_FAILURE); } @@ -122,92 +142,118 @@ processReturn CloudfuseMngr::spawnProcess(char *const argv[], char *const envp[] } } -processReturn CloudfuseMngr::genS3Config(std::string region, std::string endpoint, std::string bucketName, std::string passphrase) { +processReturn CloudfuseMngr::genS3Config(std::string region, std::string endpoint, std::string bucketName, + std::string passphrase) +{ std::string configArg = "--config-file=" + templateFile; std::string outputArg = "--output-file=" + configFile; std::string fileCachePathArg = "--temp-path=" + fileCacheDir; std::string passphraseArg = "--passphrase=" + passphrase; - char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("gen-config"), const_cast(configArg.c_str()), - const_cast(outputArg.c_str()), const_cast(fileCachePathArg.c_str()), const_cast(passphraseArg.c_str()), NULL}; - + char *const argv[] = {const_cast("/bin/cloudfuse"), + const_cast("gen-config"), + const_cast(configArg.c_str()), + const_cast(outputArg.c_str()), + const_cast(fileCachePathArg.c_str()), + const_cast(passphraseArg.c_str()), + NULL}; + std::string bucketNameEnv = "BUCKET_NAME=" + bucketName; std::string endpointEnv = "ENDPOINT=" + endpoint; std::string regionEnv = "AWS_REGION=" + region; - char *const envp[] = {const_cast(bucketNameEnv.c_str()), const_cast(endpointEnv.c_str()), const_cast(regionEnv.c_str()), NULL}; + char *const envp[] = {const_cast(bucketNameEnv.c_str()), const_cast(endpointEnv.c_str()), + const_cast(regionEnv.c_str()), NULL}; return spawnProcess(argv, envp); } -processReturn CloudfuseMngr::dryRun(std::string accessKeyId, std::string secretAccessKey, std::string passphrase) { +processReturn CloudfuseMngr::dryRun(std::string accessKeyId, std::string secretAccessKey, std::string passphrase) +{ std::string configArg = "--config-file=" + configFile; std::string passphraseArg = "--passphrase=" + passphrase; - char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("mount"), const_cast(mountDir.c_str()), const_cast(configArg.c_str()), - const_cast(passphraseArg.c_str()), const_cast("--dry-run"), NULL}; + char *const argv[] = {const_cast("/bin/cloudfuse"), + const_cast("mount"), + const_cast(mountDir.c_str()), + const_cast(configArg.c_str()), + const_cast(passphraseArg.c_str()), + const_cast("--dry-run"), + NULL}; std::string awsAccessKeyIdEnv = "AWS_ACCESS_KEY_ID=" + accessKeyId; std::string awsSecretAccessKeyEnv = "AWS_SECRET_ACCESS_KEY=" + secretAccessKey; - char *const envp[] = {const_cast(awsAccessKeyIdEnv.c_str()), const_cast(awsSecretAccessKeyEnv.c_str()), NULL}; - + char *const envp[] = {const_cast(awsAccessKeyIdEnv.c_str()), + const_cast(awsSecretAccessKeyEnv.c_str()), NULL}; + return spawnProcess(argv, envp); } -processReturn CloudfuseMngr::mount(std::string accessKeyId, std::string secretAccessKey, std::string passphrase) { +processReturn CloudfuseMngr::mount(std::string accessKeyId, std::string secretAccessKey, std::string passphrase) +{ std::string configArg = "--config-file=" + configFile; std::string passphraseArg = "--passphrase=" + passphrase; - char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("mount"), const_cast(mountDir.c_str()), const_cast(configArg.c_str()), - const_cast(passphraseArg.c_str()), NULL}; - + char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("mount"), + const_cast(mountDir.c_str()), const_cast(configArg.c_str()), + const_cast(passphraseArg.c_str()), NULL}; + std::string awsAccessKeyIdEnv = "AWS_ACCESS_KEY_ID=" + accessKeyId; std::string awsSecretAccessKeyEnv = "AWS_SECRET_ACCESS_KEY=" + secretAccessKey; - char *const envp[] = {const_cast(awsAccessKeyIdEnv.c_str()), const_cast(awsSecretAccessKeyEnv.c_str()), NULL}; + char *const envp[] = {const_cast(awsAccessKeyIdEnv.c_str()), + const_cast(awsSecretAccessKeyEnv.c_str()), NULL}; return spawnProcess(argv, envp); } -processReturn CloudfuseMngr::unmount() { - char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("unmount"), const_cast(mountDir.c_str()), const_cast("-z"), NULL}; - char *const envp[] = {const_cast("PATH=/bin"), NULL}; +processReturn CloudfuseMngr::unmount() +{ + char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("unmount"), + const_cast(mountDir.c_str()), const_cast("-z"), NULL}; + char *const envp[] = {const_cast("PATH=/bin"), NULL}; return spawnProcess(argv, envp); } -bool CloudfuseMngr::isInstalled() { - char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("version"), NULL}; - +bool CloudfuseMngr::isInstalled() +{ + char *const argv[] = {const_cast("/bin/cloudfuse"), const_cast("version"), NULL}; + return spawnProcess(argv, NULL).errCode == 0; } -bool CloudfuseMngr::isMounted() { +bool CloudfuseMngr::isMounted() +{ // Logic based on os.ismount implementation in Python. struct stat buf1, buf2; - if (lstat(mountDir.c_str(), &buf1) != 0) { + if (lstat(mountDir.c_str(), &buf1) != 0) + { // Folder doesn't exist, so not mounted return false; } - if S_ISLNK(buf1.st_mode) { + if S_ISLNK (buf1.st_mode) + { // Mount can't be a symbolic link return false; } std::string parent = mountDir + "/.."; - if (lstat(parent.c_str(), &buf2) != 0) { + if (lstat(parent.c_str(), &buf2) != 0) + { return false; } - if (buf1.st_dev != buf2.st_dev) { + if (buf1.st_dev != buf2.st_dev) + { // Directory on a different path from parent, so this is mounted return true; } - if (buf1.st_ino == buf2.st_ino) { + if (buf1.st_ino == buf2.st_ino) + { // These point to the same inode, so this is mounted return true; } - return false; } diff --git a/src/cloudfuse/child_process_windows.cpp b/src/cloudfuse/child_process_windows.cpp index 07eed25..b036e0b 100644 --- a/src/cloudfuse/child_process_windows.cpp +++ b/src/cloudfuse/child_process_windows.cpp @@ -50,13 +50,17 @@ allow-other: true region: { AWS_REGION } )"; -CloudfuseMngr::CloudfuseMngr() { +CloudfuseMngr::CloudfuseMngr() +{ std::string appdataEnv; const char *appdata = std::getenv("APPDATA"); std::string appdataString = std::string(appdata); - if (appdata == nullptr) { + if (appdata == nullptr) + { appdataEnv = ""; - } else { + } + else + { appdataEnv = appdataString; } mountDir = "Z:"; @@ -65,55 +69,63 @@ CloudfuseMngr::CloudfuseMngr() { templateFile = appdataEnv + "\\.cloudfuse\\nx_plugin_config.yaml"; std::ifstream in(templateFile.c_str()); - if (!in.good()) { + if (!in.good()) + { std::ofstream out(templateFile.c_str()); out << config_template; out.close(); } } -CloudfuseMngr::CloudfuseMngr(std::string mountDir, std::string configFile, std::string fileCacheDir) { +CloudfuseMngr::CloudfuseMngr(std::string mountDir, std::string configFile, std::string fileCacheDir) +{ this->mountDir = mountDir; this->configFile = configFile; this->fileCacheDir = fileCacheDir; templateFile = "./nx_plugin_config.yam"; std::ifstream in(templateFile.c_str()); - if (!in.good()) { + if (!in.good()) + { std::ofstream out(templateFile.c_str()); out << config_template; out.close(); } } -processReturn CloudfuseMngr::spawnProcess(wchar_t* argv, std::wstring envp) { +processReturn CloudfuseMngr::spawnProcess(wchar_t *argv, std::wstring envp) +{ processReturn ret; STARTUPINFO si; PROCESS_INFORMATION pi; - // Set the bInheritHandle flag so pipe handles are inherited. + // Set the bInheritHandle flag so pipe handles are inherited. SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; HANDLE hReadStdOut, hWriteStdOut, hReadStdErr, hWriteStdErr; - // Create a pipe for the child process's STDOUT. - if (!CreatePipe(&hReadStdOut, &hWriteStdOut, &sa, 0)) { - exit(1); + // Create a pipe for the child process's STDOUT. + if (!CreatePipe(&hReadStdOut, &hWriteStdOut, &sa, 0)) + { + exit(1); } // Ensure the read handle to the pipe for STDOUT is not inherited. - if (!SetHandleInformation(hReadStdOut, HANDLE_FLAG_INHERIT, 0) ){ + if (!SetHandleInformation(hReadStdOut, HANDLE_FLAG_INHERIT, 0)) + { exit(1); } - // Create a pipe for the child process's STDERR. - if (!CreatePipe(&hReadStdErr, &hWriteStdErr, &sa, 0)) { - exit(1); + // Create a pipe for the child process's STDERR. + if (!CreatePipe(&hReadStdErr, &hWriteStdErr, &sa, 0)) + { + exit(1); } // Ensure the read handle to the pipe for STDERR is not inherited. - if (!SetHandleInformation(hReadStdErr, HANDLE_FLAG_INHERIT, 0) ){ + if (!SetHandleInformation(hReadStdErr, HANDLE_FLAG_INHERIT, 0)) + { exit(1); } @@ -127,14 +139,16 @@ processReturn CloudfuseMngr::spawnProcess(wchar_t* argv, std::wstring envp) { LPVOID lpvEnv = GetEnvironmentStringsW(); // If the returned pointer is NULL, exit. - if (lpvEnv == NULL) { - printf("GetEnvironmentStrings failed (%d)\n", GetLastError()); + if (lpvEnv == NULL) + { + printf("GetEnvironmentStrings failed (%d)\n", GetLastError()); exit(1); } - + // Append current environment to new environment variables - LPTSTR lpszVariable = (LPTSTR) lpvEnv; - while (*lpszVariable) { + LPTSTR lpszVariable = (LPTSTR)lpvEnv; + while (*lpszVariable) + { envp += lpszVariable; envp += L'\0'; lpszVariable += lstrlen(lpszVariable) + 1; @@ -143,25 +157,24 @@ processReturn CloudfuseMngr::spawnProcess(wchar_t* argv, std::wstring envp) { // Environment block must be double null terminated envp += L'\0'; - // Start the child process. - if( !CreateProcessW( - NULL, // No module name (use command line) - LPWSTR(argv), // Command line - NULL, // Process handle not inheritable - NULL, // Thread handle not inheritable - TRUE, // Set handle inheritance to FALSE - CREATE_UNICODE_ENVIRONMENT, // Use unicode environment - (LPVOID)envp.c_str(), // Use new environment - NULL, // Use parent's starting directory - &si, // Pointer to STARTUPINFO structure - &pi ) // Pointer to PROCESS_INFORMATION structure - ) + // Start the child process. + if (!CreateProcessW(NULL, // No module name (use command line) + LPWSTR(argv), // Command line + NULL, // Process handle not inheritable + NULL, // Thread handle not inheritable + TRUE, // Set handle inheritance to FALSE + CREATE_UNICODE_ENVIRONMENT, // Use unicode environment + (LPVOID)envp.c_str(), // Use new environment + NULL, // Use parent's starting directory + &si, // Pointer to STARTUPINFO structure + &pi) // Pointer to PROCESS_INFORMATION structure + ) { CloseHandle(hWriteStdOut); CloseHandle(hReadStdOut); CloseHandle(hWriteStdErr); CloseHandle(hReadStdErr); - printf( "CreateProcess failed (%d).\n", GetLastError() ); + printf("CreateProcess failed (%d).\n", GetLastError()); return ret; } @@ -179,11 +192,13 @@ processReturn CloudfuseMngr::spawnProcess(wchar_t* argv, std::wstring envp) { const int BUFSIZE = 4096; DWORD bytesRead; CHAR buffer[BUFSIZE]; - while (ReadFile(hReadStdOut, buffer, BUFSIZE-1, &bytesRead, NULL) && bytesRead > 0) { + while (ReadFile(hReadStdOut, buffer, BUFSIZE - 1, &bytesRead, NULL) && bytesRead > 0) + { buffer[bytesRead] = 0; ret.output.append(buffer); } - while (ReadFile(hReadStdErr, buffer, BUFSIZE-1, &bytesRead, NULL) && bytesRead > 0) { + while (ReadFile(hReadStdErr, buffer, BUFSIZE - 1, &bytesRead, NULL) && bytesRead > 0) + { buffer[bytesRead] = 0; ret.output.append(buffer); } @@ -194,65 +209,76 @@ processReturn CloudfuseMngr::spawnProcess(wchar_t* argv, std::wstring envp) { return ret; } -processReturn CloudfuseMngr::genS3Config(std::string accessKeyId, std::string secretAccessKey, std::string region, std::string endpoint, std::string bucketName, std::string passphrase) { - std::string argv = "cloudfuse gen-config --config-file=" + templateFile + " --output-file=" + configFile + " --temp-path=" + fileCacheDir + " --passphrase=" + passphrase; +processReturn CloudfuseMngr::genS3Config(std::string accessKeyId, std::string secretAccessKey, std::string region, + std::string endpoint, std::string bucketName, std::string passphrase) +{ + std::string argv = "cloudfuse gen-config --config-file=" + templateFile + " --output-file=" + configFile + + " --temp-path=" + fileCacheDir + " --passphrase=" + passphrase; std::string aws_access_key_id_env = "AWS_ACCESS_KEY_ID=" + accessKeyId; std::string aws_secret_access_key_env = "AWS_SECRET_ACCESS_KEY=" + secretAccessKey; std::string aws_region_env = "AWS_REGION=" + region; std::string endpoint_env = "ENDPOINT=" + endpoint; std::string bucket_name_env = "BUCKET_NAME=" + bucketName; - std::string envp = aws_access_key_id_env + '\0'+ aws_secret_access_key_env + '\0' + aws_region_env + '\0' + endpoint_env + '\0' + bucket_name_env + '\0'; + std::string envp = aws_access_key_id_env + '\0' + aws_secret_access_key_env + '\0' + aws_region_env + '\0' + + endpoint_env + '\0' + bucket_name_env + '\0'; std::wstring wargv = std::wstring_convert, wchar_t>().from_bytes(argv); std::wstring wenvp = std::wstring_convert, wchar_t>().from_bytes(envp); - - return spawnProcess(const_cast(wargv.c_str()), wenvp); + + return spawnProcess(const_cast(wargv.c_str()), wenvp); } -processReturn CloudfuseMngr::dryRun(std::string passphrase) { - std::string argv = "cloudfuse mount " + mountDir + " --config-file=" + configFile + " --passphrase=" + passphrase + " --dry-run"; +processReturn CloudfuseMngr::dryRun(std::string passphrase) +{ + std::string argv = + "cloudfuse mount " + mountDir + " --config-file=" + configFile + " --passphrase=" + passphrase + " --dry-run"; std::string envp = ""; std::wstring wargv = std::wstring_convert, wchar_t>().from_bytes(argv); std::wstring wenvp = std::wstring_convert, wchar_t>().from_bytes(envp); - - return spawnProcess(const_cast(wargv.c_str()), wenvp); + + return spawnProcess(const_cast(wargv.c_str()), wenvp); } -processReturn CloudfuseMngr::mount(std::string passphrase) { +processReturn CloudfuseMngr::mount(std::string passphrase) +{ std::string argv = "cloudfuse mount " + mountDir + " --config-file=" + configFile + " --passphrase=" + passphrase; std::string envp = ""; std::wstring wargv = std::wstring_convert, wchar_t>().from_bytes(argv); std::wstring wenvp = std::wstring_convert, wchar_t>().from_bytes(envp); - - return spawnProcess(const_cast(wargv.c_str()), wenvp); + + return spawnProcess(const_cast(wargv.c_str()), wenvp); } -processReturn CloudfuseMngr::unmount() { +processReturn CloudfuseMngr::unmount() +{ std::string argv = "cloudfuse unmount " + mountDir; std::string envp = ""; - + std::wstring wargv = std::wstring_convert, wchar_t>().from_bytes(argv); std::wstring wenvp = std::wstring_convert, wchar_t>().from_bytes(envp); - - return spawnProcess(const_cast(wargv.c_str()), wenvp); + + return spawnProcess(const_cast(wargv.c_str()), wenvp); } -bool CloudfuseMngr::isInstalled() { +bool CloudfuseMngr::isInstalled() +{ std::string argv = "cloudfuse version"; std::string envp = ""; - + std::wstring wargv = std::wstring_convert, wchar_t>().from_bytes(argv); std::wstring wenvp = std::wstring_convert, wchar_t>().from_bytes(envp); - - return spawnProcess(const_cast(wargv.c_str()), wenvp).errCode == 0; + + return spawnProcess(const_cast(wargv.c_str()), wenvp).errCode == 0; } -bool CloudfuseMngr::isMounted() { +bool CloudfuseMngr::isMounted() +{ std::wstring mountDirW = std::wstring(mountDir.begin(), mountDir.end()); DWORD fileAttributes = GetFileAttributes(mountDirW.c_str()); - if (fileAttributes == INVALID_FILE_ATTRIBUTES) { + if (fileAttributes == INVALID_FILE_ATTRIBUTES) + { return false; } return true; diff --git a/tools/format.sh b/tools/format.sh index 1cbf46d..a9d62a2 100755 --- a/tools/format.sh +++ b/tools/format.sh @@ -1,4 +1,5 @@ #!/bin/bash find ./samples/cloudfuse_plugin/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i -find ./samples/unit_tests/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i \ No newline at end of file +find ./samples/unit_tests/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i +find ./src/cloudfuse/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i \ No newline at end of file