Browse Source

VC++还是使用原始文件名作为git short id值。

Jeff 1 month ago
parent
commit
18efc8ca51
1 changed files with 12 additions and 5 deletions
  1. 12 5
      gitver/gitver/gitver.cpp

+ 12 - 5
gitver/gitver/gitver.cpp

@@ -44,6 +44,11 @@ void GetDirInfo()
 		_stprintf_s(g_szFolderName, _T("%s"), strVal.GetString());
 	}
 
+#ifdef _DEBUG
+	_stprintf_s(g_szFolderName, _T("Hartmann"));
+	_stprintf_s(g_szCurModuleDir, _T("F:\\Hartmann2\\Hartmann"));
+#endif
+
     // 必须要设置为当前路径为程序路径,因为外部调用者目录不同;
     SetCurrentDirectory(g_szCurModuleDir);
 }
@@ -204,7 +209,7 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
             _stprintf_s(szOriginalFilename, _T("%s"), argv[2]);
         
 #ifdef _DEBUG
-        CString strValue = StartProcess(NULL, "cmd /c git rev-parse --short HEAD", _T("F:\\cfg\\Moka_CShare_FactoryTool\\FactoryTool_CShare"));
+        CString strValue = StartProcess(NULL, "cmd /c git rev-parse --short HEAD", _T("F:\\Hartmann2\\Hartmann"));
 #else
 		CString strValue = StartProcess(NULL, "cmd /c git rev-parse --short HEAD", NULL);
 #endif
@@ -243,17 +248,19 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
 			//strValue = StartProcess(NULL, "cmd /c git rev-parse HEAD", NULL);
 			//strValue.Replace(_T("\n"),_T(""));
 
-			//_stprintf_s(szValue, "VALUE \"OriginalFilename\", \"%s.exe\"", g_szFolderName);
-			//vtOldContent.push_back(szValue);
+			_stprintf_s(szValue, "VALUE \"OriginalFilename\", \"%s.exe\"", g_szFolderName);
+			vtOldContent.push_back(szValue);
 
-			//_stprintf_s(szValue, "VALUE \"OriginalFilename\", \"%s\"", strValue.GetString());
-			//vtNewContent.push_back(szValue);
+			_stprintf_s(szValue, "VALUE \"OriginalFilename\", \"%s\"", strValue.GetString());
+			vtNewContent.push_back(szValue);
 
+#if 0
 			_stprintf_s(szValue, "VALUE \"FileDescription\", \"TODO: <文件说明>\"");
 			vtOldContent.push_back(szValue);
 
 			_stprintf_s(szValue, "VALUE \"FileDescription\", \"%s\"", strValue.GetString());
 			vtNewContent.push_back(szValue);
+#endif
 #endif
 		}
 		else if ( nCodeType == 2 )