Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moxun33 committed Feb 13, 2023
1 parent 30ab408 commit 8e5dbde
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions docs/remark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 备注

## 获取``pubspec.yaml``的version
```bash
cat pubspec.yaml | grep 'version:' | head -1 | cut -f2- -d: | sed -e 's/^[ \t]*//'
```

## 提升版本号
```bash
awk '{ match($0,/([0-9]+)\+([0-9]+)/,a); a[1]=a[1]+1; a[2]=a[2]+1; sub(/[0-9]+\+[0-9]+/,a[1]"+"a[2])}1' pubspec.yaml | grep 'version:' | head -1 | cut -f2- -d: | sed -e 's/^[ \t]*//'
```

## 更新``pubspec.yaml``的version
```bash
awk '{ match($0,/([0-9]+)\+([0-9]+)/,a); a[1]=a[1]+1; a[2]=a[2]+1; sub(/[0-9]+\+[0-9]+/,a[1]"+"a[2])}1' pubspec.yaml | grep 'version:' | head -1 | cut -f2- -d: | sed -e 's/^[ \t]*//'
```
4 changes: 2 additions & 2 deletions lib/common/values/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DEF_EPG_URL = 'http://epg.51zmt.top:8000/api/diyp/';
//默认弹幕字体大小
const DEF_DM_FONT_SIZE = 20;

const bool IS_PROD_ENV = bool.fromEnvironment("dart.vm.product");
const bool IS_RELEASE = bool.fromEnvironment("dart.vm.product");

//assets目录
final ASSETS_DIR = IS_PROD_ENV ? 'data/flutter_assets/assets' : 'assets';
final ASSETS_DIR = IS_RELEASE ? 'data/flutter_assets/assets' : 'assets';
2 changes: 1 addition & 1 deletion lib/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Global {
static bool isOfflineLogin = true;

/// 是否 release
static bool get isRelease => bool.fromEnvironment("dart.vm.product");
static bool get isRelease => IS_RELEASE;

/// init
static Future<ThemeData> init({bool shouldSetSize = true}) async {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.4.4+1
version: 0.5.2+2

environment:
sdk: ">=2.17.0 <3.0.0"
Expand Down

0 comments on commit 8e5dbde

Please sign in to comment.