Commit 8b36126b authored by David黄金龙's avatar David黄金龙

Merge branch 'new_product' into 'develop'

New product合并到dev

See merge request !29
parents 123191bf 4b8edcdf
......@@ -171,8 +171,6 @@ target 'galaxy' do
pod 'xxtea', '1.0.2'
#代码规范
pod 'SwiftLint', :configurations => ['Debug']
# 跟踪app性能
pod 'Sentry'
#腾讯IM
tencentIM_pods
#腾讯客服
......
This diff is collapsed.
......@@ -6,7 +6,6 @@
//
import UIKit
import Sentry
import ESTabBarController_swift
import IQKeyboardManagerSwift
......@@ -30,7 +29,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
configSentry()
Thread.sleep(forTimeInterval: 0.5) // 应产品同学Nick要求 启动页时间展示长点
setupAudionConfig()
......@@ -469,38 +467,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
extension AppDelegate {
private func configSentry() {
SentrySDK.start { options in
options.dsn = "https://41235d99f7163a287785964dae61d5a9@dev-sentry.galaxy-immi.com/7"
// Adds IP for users.
// For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
options.sendDefaultPii = true
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0
// Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.
options.configureProfiling = {
$0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.
$0.lifecycle = .trace
}
#if DEBUG || TESTENV
// Uncomment the following lines to add more data to your events
options.attachScreenshot = true // This adds a screenshot to the error events
options.attachViewHierarchy = true // This adds the view hierarchy to the error events
options.debug = true // Enabled debug when first installing is always helpful
options.environment = "debug"
#else
options.debug = false // Enabled debug when first installing is always helpful
options.environment = "production"
options.attachViewHierarchy = true
#endif
}
// Remove the next line after confirming that your Sentry integration is working.
// SentrySDK.capture(message: "This app uses Sentry! :)")
}
private func thirdSetting() {
// 1.数据解析
#if DEBUG
......
......@@ -7,16 +7,19 @@
//
import UIKit
import SmartCodable
class YHActivityDetailModel: YHActivityModel {
// var cover : String = "" //活动封面
// var name : String = "" //活动标题
// var tag : Int = 0 //活动标签枚举 1:V专享
// var beginTime : String = "" //开始时间戳
// var endTime : String = "" //结束时间戳
// var place : String = "" //活动地点
// var id : Int = 0 //活动ID
// var status : String = "" //活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名
class YHActivityDetailModel: SmartCodable {
var id: Int = 0 // 活动ID
var tag: Int = 0 // 活动标签枚举 1:V专享
var name: String = "" // 活动标题
var cover: String = "" // 活动封面
var beginTime: String = "" // 开始时间戳
var endTime: String = "" // 结束时间戳
var place: String = "" // 活动地点
var status: String = "" // 活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名 5:已下架
var checkId: String = "" // 活动行程ID 仅当活动状态为2(已报名)时才大于0
var tips: String = "" // 温馨提示
var guidance: String = "" // 交通引导
......@@ -37,4 +40,57 @@ class YHActivityDetailModel: YHActivityModel {
coverItems.append(item)
}
}
required init() {
}
private var beginTimeForUI: String = ""
func getDateString(format: String = "MM/dd") -> String {
if beginTimeForUI.isEmpty {
if let tttt = beginTime.double() {
// 1.
// 将时间戳转换为Date对象
let date = Date(timeIntervalSince1970: TimeInterval(tttt))
// 创建一个DateFormatter实例
let dateFormatter = DateFormatter()
// 设置日期格式,这里设置为"年-月-日 时:分:秒"
dateFormatter.dateFormat = format // HH:mm:ss
// 使用DateFormatter将Date对象转换为字符串
let dateString = dateFormatter.string(from: date)
dateFormatter.dateFormat = "HH:mm"
let titmeString = dateFormatter.string(from: date)
// 获取Calendar的当前实例
let calendar = Calendar.current
// 使用Calendar来获取星期几
let weekday = calendar.component(.weekday, from: date)
// 星期几的名称,根据weekday的值,1到7分别代表周一到周日
if weekday > 0 && weekday < 8 {
let weekdayName = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][weekday - 1]
if let tttt = endTime.double() {
// 将时间戳转换为Date对象
let date2 = Date(timeIntervalSince1970: TimeInterval(tttt))
let titmeString2 = dateFormatter.string(from: date2)
if titmeString.contains(titmeString2) {
beginTimeForUI = dateString + " " + weekdayName + " " + titmeString
} else {
beginTimeForUI = dateString + " " + weekdayName + " " + titmeString + "-" + titmeString2
}
}
}
}
}
return beginTimeForUI
}
}
......@@ -18,10 +18,74 @@ class YHActivityApplyInfoModel: SmartCodable {
}
}
class YHActivityTravelModel: YHActivityModel {
class YHActivityTravelModel: SmartCodable {
var id: Int = 0 // 活动ID
var tag: Int = 0 // 活动标签枚举 1:V专享
var name: String = "" // 活动标题
var cover: String = "" // 活动封面
var beginTime: String = "" // 开始时间戳
var endTime: String = "" // 结束时间戳
var place: String = "" // 活动地点
var status: String = "" // 活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名 5:已下架
var checkId: String = "" // 活动行程ID 仅当活动状态为2(已报名)时才大于0
var statusCn: String = "" // 行程状态
var user: YHActivityApplyInfoModel?
var tips: String = "" // 温馨提示
var guidance: String = "" // 交通引导
required init() {
}
private var beginTimeForUI: String = ""
func getDateString(format: String = "MM/dd") -> String {
if beginTimeForUI.isEmpty {
if let tttt = beginTime.double() {
// 1.
// 将时间戳转换为Date对象
let date = Date(timeIntervalSince1970: TimeInterval(tttt))
// 创建一个DateFormatter实例
let dateFormatter = DateFormatter()
// 设置日期格式,这里设置为"年-月-日 时:分:秒"
dateFormatter.dateFormat = format // HH:mm:ss
// 使用DateFormatter将Date对象转换为字符串
let dateString = dateFormatter.string(from: date)
dateFormatter.dateFormat = "HH:mm"
let titmeString = dateFormatter.string(from: date)
// 获取Calendar的当前实例
let calendar = Calendar.current
// 使用Calendar来获取星期几
let weekday = calendar.component(.weekday, from: date)
// 星期几的名称,根据weekday的值,1到7分别代表周一到周日
if weekday > 0 && weekday < 8 {
let weekdayName = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][weekday - 1]
if let tttt = endTime.double() {
// 将时间戳转换为Date对象
let date2 = Date(timeIntervalSince1970: TimeInterval(tttt))
let titmeString2 = dateFormatter.string(from: date2)
if titmeString.contains(titmeString2) {
beginTimeForUI = dateString + " " + weekdayName + " " + titmeString
} else {
beginTimeForUI = dateString + " " + weekdayName + " " + titmeString + "-" + titmeString2
}
}
}
}
}
return beginTimeForUI
}
}
......@@ -7,8 +7,8 @@
//
import UIKit
class YHActivityCoverItem {
import SmartCodable
class YHActivityCoverItem: SmartCodable {
var url: String = ""
let width: CGFloat = KScreenWidth-40.0
var height: CGFloat = KScreenWidth-40.0
......@@ -18,6 +18,9 @@ class YHActivityCoverItem {
view.clipsToBounds = true
return view
}()
required init() {
}
}
class YHActivityDetailCell1: UITableViewCell {
......
......@@ -60,20 +60,13 @@ extension YHActivityViewModel {
// 1. json字符串 转 对象
if json.code == 200 {
guard let dic = json.data?.peel as? [String: Any], let result = YHActivityTravelModel.deserialize(from: dic) else {
self.activityTravelModel = nil
callBackBlock(false, nil)
return
}
self.activityTravelModel = result
callBackBlock(true, nil)
} else {
// self.activityTravelModel = nil
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
// self.activityTravelModel = nil
callBackBlock(false, err)
}
}
......
......@@ -44,7 +44,20 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
var progBar = UIProgressView()
var bottomView: YHHomeWebBottomView!
var url = ""
var url = "" {
didSet {
if url.contains("isLogin=") {
printLog("RESULT_URL: \(url)")
return
}
let is_login = YHLoginManager.shared.isLogin() ? 1 : 0
if url.contains("?") {
url += "&isLogin=\(is_login)"
} else {
url += "?isLogin=\(is_login)"
}
}
}
var id: Int = 0
var vcTitle: String?
var model: YHWebModel = YHWebModel()
......
......@@ -136,6 +136,30 @@ private extension YHHomeKingKongBlockView {
case 7:
// 生意星
gotoBusinessStar()
case 8:
// 银河新品
var url = YHBaseUrlManager.shared.businessH5Url() + "/yh-new-goods/detail"
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
let urlHasParam = String.hasQueryParameters(urlString: url)
if urlHasParam {
url = url + "&param=" + token
} else {
url = url + "?param=" + token
}
}
// 2.增加导航栏高度 https://test-hklife.galaxy-immi.com/superAppBridge.html#/goods/sales-detail?id=
var tUrl = url
if !url.contains("navigationH=") {
tUrl = url + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
if url.contains("?") {
tUrl = url + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
}
}
let vc = YHH5WebViewVC()
vc.url = tUrl
UIViewController.current?.navigationController?.pushViewController(vc)
default:
break
}
......
//
// YHNewProductCell.swift
// galaxy
//
// Created by Dufet on 2025/10/12.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHNewProductCell: UITableViewCell {
static let cellReuseIdentifier = "YHNewProductCell"
var model: YHSelectGoodsModel = YHSelectGoodsModel()
var onImageHeightChanged: (() -> Void)?
lazy var imgView: UIImageView = {
let v = UIImageView()
v.contentMode = .scaleAspectFill
v.clipsToBounds = true
return v
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func updateModel(_ model: YHSelectGoodsModel) {
self.model = model
if let url = URL(string: model.image) {
imgView.sd_setImage(with: url, placeholderImage: UIImage(named: "plan_product_default")) { [weak self] image, _, _, resultUrl in
guard let self = self else {
return
}
guard resultUrl?.absoluteString == self.model.image else {
return
}
guard let image = image, image.size.width > 0, image.size.height > 0 else {
return
}
model.ratio = image.size.height / image.size.width
self.imgView.snp.updateConstraints { make in
make.height.equalTo(model.ratio * (KScreenWidth-20.0*2))
}
self.onImageHeightChanged?()
}
} else {
imgView.snp.updateConstraints { make in
make.height.equalTo(YHSelectGoodsModel.fix_new_productRatio * (KScreenWidth-20.0*2))
}
}
}
func setupUI() {
self.selectionStyle = .none
self.contentView.addSubview(self.imgView)
self.imgView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalToSuperview()
make.height.equalTo(YHSelectGoodsModel.fix_new_productRatio * (KScreenWidth-20.0*2))
make.bottom.equalTo(-12)
}
}
}
......@@ -127,6 +127,7 @@ extension YHSelectViewController {
head.block = { index in
self.selectItem = index
self.buttonItem = 0
self.tableView.reloadData()
self.updataData()
}
head.buttonBlock = { index in
......@@ -147,7 +148,9 @@ extension YHSelectViewController {
tableView.delegate = self
tableView.tableHeaderView = sectionView
tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 250))
tableView.register(cellWithClass: YHSelectLookTableViewCell.self)
tableView.register(YHSelectLookTableViewCell.self, forCellReuseIdentifier: YHSelectLookTableViewCell.cellReuseIdentifier)
tableView.register(YHNewProductCell.self, forCellReuseIdentifier: YHNewProductCell.cellReuseIdentifier)
return tableView
}()
view.addSubview(tableView)
......@@ -185,13 +188,36 @@ extension YHSelectViewController: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHSelectLookTableViewCell.self)
let model = self.viewModel.goodsArray[indexPath.row]
if model.goodsCategoryType == 1 { // 新品商品
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHNewProductCell.cellReuseIdentifier, for: indexPath) as? YHNewProductCell else {
return UITableViewCell()
}
cell.updateModel(model)
cell.onImageHeightChanged = { [weak self] in
guard let self = self else { return }
UIView.performWithoutAnimation {
self.tableView.reloadRows(at: [indexPath], with: .none)
}
}
return cell
}
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectLookTableViewCell.cellReuseIdentifier, for: indexPath) as? YHSelectLookTableViewCell else {
return UITableViewCell()
}
cell.number = indexPath.row
cell.dataSource = self.viewModel.goodsArray[indexPath.row]
cell.dataSource = model
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let model = self.viewModel.goodsArray[indexPath.row]
if model.goodsCategoryType == 1 { // 新品商品
return UITableView.automaticDimension
}
if indexPath.row == 0 {
return 102
}
......@@ -199,6 +225,9 @@ extension YHSelectViewController: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if selectItem == 0 {
return 46
}
return 66
}
......@@ -208,6 +237,7 @@ extension YHSelectViewController: UITableViewDelegate, UITableViewDataSource {
// headView.itemButton.setTitle(model.name, for: .normal)
// headView.itemButton.iconInRight(with: 0.5)
// }
return headView
}
......@@ -221,8 +251,13 @@ extension YHSelectViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = self.viewModel.goodsArray[indexPath.row]
var url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/goods/sales-detail" + "?id=\(model.id)"
YHAnalytics.track("APP_GalaxySelectionPage_ClickProduct", properties: ["productID": model.id])
var url = ""
if model.goodsCategoryType == 1 { // 新品商品
url = YHBaseUrlManager.shared.businessH5Url() + "/yh-new-goods/detail?id=" + model.id
} else {
url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/goods/sales-detail" + "?id=\(model.id)"
YHAnalytics.track("APP_GalaxySelectionPage_ClickProduct", properties: ["productID": model.id])
}
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
......@@ -264,6 +299,9 @@ extension YHSelectViewController: JXSegmentedListContainerViewListDelegate {
}
class YHSelectLookTableViewCell: UITableViewCell {
static let cellReuseIdentifier = "YHSelectLookTableViewCell"
var centerImageView: UIImageView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
......
......@@ -35,6 +35,8 @@ class YHSelectGoodModel: SmartCodable {
class YHSelectGoodsModel: SmartCodable {
static let fix_new_productRatio = 160.0/335
var id: String = ""
var name: String = ""
var products: [Int] = []
......@@ -64,8 +66,13 @@ class YHSelectGoodsModel: SmartCodable {
var icons: [YHSelectGoodIconModel] = []
// 货币符号 HKD、CNY
var currency: String = ""
var goodsCategoryType: Int = 0 // 产品的分类类型:0 默认普通,1 新品商品
// 新品图片宽高比
var ratio: CGFloat = YHSelectGoodsModel.fix_new_productRatio
required init() {
}
}
......
......@@ -21,6 +21,7 @@ class YHSelectLookHeadView: UIView {
normalButton.isSelected = true
hotButton.isSelected = false
priceButton.isSelected = false
} else if buttonIndex == 1 {
normalButton.isSelected = false
hotButton.isSelected = true
......@@ -99,6 +100,7 @@ class YHSelectLookHeadView: UIView {
// button.setImage(UIImage(named: "home_select_icon_select"), for: .selected)
button.addTarget(self, action: #selector(normalClick), for: .touchUpInside)
button.isSelected = true
button.isHidden = true
return button
}()
addSubview(normalButton)
......@@ -118,6 +120,7 @@ class YHSelectLookHeadView: UIView {
button.setTitleColor(UIColor.brandMainColor, for: .selected)
// button.setImage(UIImage(named: "home_select_icon_select"), for: .selected)
button.addTarget(self, action: #selector(hotClick), for: .touchUpInside)
button.isHidden = true
return button
}()
addSubview(hotButton)
......@@ -137,6 +140,7 @@ class YHSelectLookHeadView: UIView {
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setImage(UIImage(named: "home_select_icon_select"), for: .selected)
button.addTarget(self, action: #selector(priceClick), for: .touchUpInside)
button.isHidden = true
return button
}()
addSubview(priceButton)
......@@ -213,6 +217,14 @@ extension YHSelectLookHeadView: UICollectionViewDelegate, UICollectionViewDataSo
collectionView.reloadData()
if let block = block {
block(indexPath.row)
normalButton.isHidden = false
hotButton.isHidden = false
priceButton.isHidden = false
if indexPath.row == 0 {
normalButton.isHidden = true
hotButton.isHidden = true
priceButton.isHidden = true
}
}
collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
}
......
......@@ -56,7 +56,20 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
return view
}()
var url = ""
var url = "" {
didSet {
if url.contains("isLogin=") {
// printLog("RESULT_URL: \(url)")
return
}
let is_login = YHLoginManager.shared.isLogin() ? 1 : 0
if url.contains("?") {
url += "&isLogin=\(is_login)"
} else {
url += "?isLogin=\(is_login)"
}
}
}
var navTitle = "" // 导航栏title
lazy var noNetWorkTipsView: YHEmptyDataView = {
......
......@@ -351,6 +351,7 @@ extension String {
func getPrivateUrl() -> String {
var replacedString = self.replacingOccurrences(of: "prod-bucket-v1.oss-cn-shenzhen.aliyuncs.com", with: "prod-cdn.galaxy-immi.com")
replacedString = replacedString.replacingOccurrences(of: "test-bucket-v1.oss-cn-shenzhen.aliyuncs.com", with: "test-cdn.galaxy-immi.com")
replacedString = replacedString.replacingOccurrences(of: "galaxy-filecenter.oss-cn-shenzhen.aliyuncs.com", with: "cdn-oss-galaxy-filecenter.galaxy-immi.com")
return replacedString
}
}
......@@ -289,6 +289,8 @@ class YHOSSManager: NSObject, URLSessionDelegate {
return "prod-bucket-v1"
} else if url.contains("prod-cdn-pub.galaxy-immi.com") {
return "prod-bucket-v1-pub"
} else if url.contains("galaxy-filecenter.galaxy-immi.com") {
return "galaxy-filecenter"
} else {
#if DEBUG
printLog("OSS找不到正确的Bucket" )
......
#!/bin/sh
set -eu
# allow overriding the version
VERSION=${SENTRY_CLI_VERSION:-latest}
PLATFORM=`uname -s`
ARCH=`uname -m`
case "$PLATFORM" in
CYGWIN*) PLATFORM="Windows"
;;
MINGW*) PLATFORM="Windows"
;;
MSYS*) PLATFORM="Windows"
;;
Darwin) ARCH="universal"
;;
esac
case "$ARCH" in
armv6*) ARCH="armv7"
;;
armv7*) ARCH="armv7"
;;
armv8*) ARCH="aarch64"
;;
armv64*) ARCH="aarch64"
;;
aarch64*) ARCH="aarch64"
;;
esac
# If the install directory is not set, set it to a default
if [ -z ${INSTALL_DIR+x} ]; then
INSTALL_DIR=/usr/local/bin
fi
if [ -z ${INSTALL_PATH+x} ]; then
INSTALL_PATH="${INSTALL_DIR}/sentry-cli"
fi
DOWNLOAD_URL="https://release-registry.services.sentry.io/apps/sentry-cli/${VERSION}?response=download&arch=${ARCH}&platform=${PLATFORM}&package=sentry-cli"
echo "This script will automatically install sentry-cli (${VERSION}) for you."
echo "Installation path: ${INSTALL_PATH}"
if [ "x$(id -u)" = "x0" ]; then
echo "Warning: this script is currently running as root. This is dangerous. "
echo " Instead run it as normal user. We will sudo as needed."
fi
if [ -f "$INSTALL_PATH" ]; then
echo "error: sentry-cli is already installed."
echo " run \"sentry-cli update\" to update to latest version"
exit 1
fi
if ! hash curl 2> /dev/null; then
echo "error: you do not have 'curl' installed which is required for this script."
exit 1
fi
TEMP_FILE=`mktemp "${TMPDIR:-/tmp}/.sentrycli.XXXXXXXX"`
TEMP_HEADER_FILE=`mktemp "${TMPDIR:-/tmp}/.sentrycli-headers.XXXXXXXX"`
cleanup() {
rm -f "$TEMP_FILE"
rm -f "$TEMP_HEADER_FILE"
}
trap cleanup EXIT
HTTP_CODE=$(curl -SL --progress-bar "$DOWNLOAD_URL" -D "$TEMP_HEADER_FILE" --output "$TEMP_FILE" --write-out "%{http_code}")
if [ ${HTTP_CODE} -lt 200 ] || [ ${HTTP_CODE} -gt 299 ]; then
echo "error: your platform and architecture (${PLATFORM}-${ARCH}) is unsupported."
exit 1
fi
for PYTHON in python3 python2 python ''; do
if hash "$PYTHON"; then
break
fi
done
if [ "$PYTHON" ]; then
"$PYTHON" - <<EOF "${TEMP_FILE}" "${TEMP_HEADER_FILE}"
if 1:
import sys
import re
import hashlib
import binascii
validated = False
with open(sys.argv[2], "r") as f:
for line in f:
match = re.search("(?i)^digest:.?sha256=([^,\n ]+)", line)
if match is not None:
with open(sys.argv[1], "rb") as downloaded:
hasher = hashlib.sha256()
while True:
chunk = downloaded.read(4096)
if not chunk:
break
hasher.update(chunk)
calculated = hasher.digest()
expected = binascii.a2b_base64(match.group(1))
if calculated != expected:
print("error: checksum mismatch (got %s, expected %s)" % (
binascii.b2a_hex(calculated).decode("ascii"),
binascii.b2a_hex(expected).decode("ascii")
))
sys.exit(1)
validated = True
break
if not validated:
print("warning: unable to validate checksum because no checksum available")
EOF
else
echo "warning: python not available, unable to verify checksums"
fi
chmod 0755 "$TEMP_FILE"
if ! (mkdir -p "$(dirname "$INSTALL_PATH")" && mv "$TEMP_FILE" "$INSTALL_PATH") 2> /dev/null; then
sudo -k sh -c "mkdir -p \"$(dirname "$INSTALL_PATH")\" && mv \"$TEMP_FILE\" \"$INSTALL_PATH\""
fi
echo "Sucessfully installed $("$INSTALL_PATH" --version)"
VERSION=$("$INSTALL_PATH" --version | awk '{print $2}')
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
if (test -d "${HOME}/.oh-my-zsh") 2>/dev/null && [ $MAJOR -eq 2 ] && [ $MINOR -ge 22 ]; then
echo 'Detected Oh My Zsh, installing Zsh completions...'
if (mkdir -p "${HOME}/.oh-my-zsh/completions") 2>&1 && ("$INSTALL_PATH" completions zsh > "${HOME}/.oh-my-zsh/completions/_sentry_cli") 2>&1; then
echo "Successfully installed Zsh completions."
else
echo 'Warning: failed to install Zsh completions.'
fi
fi
echo 'Done!'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment