From 0d8b39c94e9bee14ec9c33fa6a53c48f20f0ac70 Mon Sep 17 00:00:00 2001 From: Maximilien Siavelis <maximilien.siavelis@simulease.com> Date: 周日, 21 4月 2019 23:06:05 +0800 Subject: [PATCH] copy ini/SimpleIni.h into install directory --- src/tools/bootstrap/bootstrap.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/tools/bootstrap/bootstrap.cpp b/src/tools/bootstrap/bootstrap.cpp index 6b22d59..4af84e9 100644 --- a/src/tools/bootstrap/bootstrap.cpp +++ b/src/tools/bootstrap/bootstrap.cpp @@ -3,6 +3,7 @@ #include <string> #include <stdlib.h> #include <iostream> +#include <sys/stat.h> using namespace std; namespace license { @@ -73,6 +74,12 @@ } } +bool file_exists (const std::string & name) +{ + struct stat buffer; + return (stat (name.c_str(), &buffer) == 0); +} + int main(int argc, char** argv) { if (argc != 3) { @@ -87,6 +94,11 @@ string private_fname = string(argv[1]); string public_fname(argv[2]); + if (file_exists(private_fname) || file_exists(public_fname)) { + printf("Key files exist, skipping key generation. Do 'make clean' to generate new keys.\n"); + exit(0); + } + license::generatePk(private_fname, public_fname); return 0; } -- Gitblit v1.9.1