Skip to content

Commit

Permalink
changes idk
Browse files Browse the repository at this point in the history
  • Loading branch information
lsproule committed Dec 11, 2023
1 parent 574a08c commit 739c644
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ CPMAddPackage(
GIT_TAG origin/master
OPTIONS
"BUILD_STATIC_LIBS ON"
"JSON_BuildTests OFF"


)
CPMAddPackage(
Expand Down Expand Up @@ -242,6 +244,14 @@ if(DIST_RPM)
set(CPACK_PACKAGE_DESCRIPTION "Frate a package/build system manager for C/C++")
set(CPACK_PACKAGE_CONTACT "Lucas Sproule frate@frate.dev")
endif()
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Lucas Sproule & Jon-Michael Hartway")
set(CPACK_PACKAGE_VERSION_MAJOR ${VMAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VMINOR})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "build-essential, cmake, git, ccache, libssh2-1, lua5.4, liblua5.4-dev")
set(CPACK_PACKAGE_DESCRIPTION "Frate a package/build system manager for C/C++")
set(CPACK_PACKAGE_CONTACT "Lucas Sproule frate@frate.dev")

include(CPack)


Expand Down
2 changes: 1 addition & 1 deletion include/Frate/Command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <Frate/Utils/CLI.hpp>
#include <Frate/Frate.hpp>


#define ENDL "\n"

namespace Frate::Command {

using nlohmann::json;
using Utils::CLI::Prompt;
using namespace Utils::CLI::Ansi;
Expand Down
3 changes: 3 additions & 0 deletions include/Frate/Constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ namespace Frate::Constants {
const std::string NAME = "frate";
const std::string DESCRIPTION = "CLI utility for managing your project, a modern touch for C/C++";
const std::string PROJECT_URL = "https://github.com/frate-dev/frate";

constexpr const std::string_view FRATE_PACKAGES = "https://github.com/frate-packages/index/releases/latest/download/index.json";
constexpr const std::string_view FRATE_TEMPLATES = "https://github.com/frate-templates/templates/releases/latest/download/index.json";

const std::string VERSION =
std::to_string(VMAJOR) + "." +
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Actions/UvWatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ namespace Frate::Command::UvWatch{
"rsync -avh --exclude-from='.gitignore' --update -e 'ssh -p " +
std::to_string(inter->pro->build_server.port) + "' --progress . " +
inter->pro->build_server.username + "@" +inter->pro->build_server.ip +
":/tmp/frate && ssh -p " +
":/tmp/frate2 && ssh -p " +
std::to_string(inter->pro->build_server.port) + " " +
inter->pro->build_server.username + "@" +inter->pro->build_server.ip +
" 'cd /tmp/frate && cmake . && make -j ${nproc} && " + inter->pro->build_dir +
" 'cd /tmp/frate2 && cmake . && make -j ${nproc} && " + inter->pro->build_dir +
inter->pro->project_name + "'";
}
if (inter->args->count("args") != 0) {
Expand Down
7 changes: 5 additions & 2 deletions src/Command/Helpers/IndexCache.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <Frate/Command.hpp>
#include <nlohmann/json.hpp>
#include <Frate/Utils/General.hpp>
#include <Frate/Constants.hpp>
#include <fstream>

namespace Frate::Command{
Expand All @@ -12,8 +13,10 @@ namespace Frate::Command{
using std::filesystem::create_directories;
std::string indexFileName =
std::string(std::getenv("HOME")) + "/.local/frate/index.json";
std::string indexUrl =
"https://github.com/frate-dev/index/releases/latest/download/index.json";

//to scare away javascript kiddies
std::string indexUrl = static_cast<std::string>(Constants::FRATE_PACKAGES);

/*
* If index is not in path then we create one
* returns fetched index
Expand Down
3 changes: 2 additions & 1 deletion src/Command/Toolchains/AvailableToolchains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace Frate::Command::Toolchain {
.triple = "aarch64-apple-ios"
},
{
.os = "iOS", .triple = "aarch64-apple-ios-macabi"
.os = "iOS",
.triple = "aarch64-apple-ios-macabi"
},
{
.os = "iOS",
Expand Down
4 changes: 2 additions & 2 deletions src/Generators/ProjectGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "inja.hpp"
#include "nlohmann/json_fwd.hpp"
#include <Frate/Generators.hpp>
#include <Frate/Constants.hpp>
#include <filesystem>
#include <git2/types.h>
#include <git2/clone.h>
Expand All @@ -16,8 +17,7 @@ using std::filesystem::path;
using Utils::CLI::Prompt;
json getTemplateIndex() {
std::cout << "Getting Template Index" << std::endl;
std::string index_url = "https://github.com/frate-dev/templates/releases/"
"latest/download/index.json";
std::string index_url = static_cast<std::string>(Constants::FRATE_TEMPLATES);

json index = json::parse(Utils::fetchText(index_url));
return index;
Expand Down

0 comments on commit 739c644

Please sign in to comment.